How to import all of the RTC Charts?
Dave_Cintron
Member Posts: 189
Does anyone know how to do this? They do not automatically populate when creating a new database. I can't believe I would have to do them one at a time...
0
Comments
-
I can't remember if I just wrote a dataport. I know I didn't type them in manually, but also know that they weren't generated by the system, so it must have been how I did it.0
-
A dataport cannot be used because these are in XML format. When I write an XMLport, I only get one chart. Does anyone know how to export all of the charts into a single file, or to otherwise copy them to a new database? NO GUESSES PLEASE.0
-
There is no build in support for exporting all the objects at once.
It is though possible to access the data:
The chart data is stored in table 2000000078 (Chart). The blob field contains the XML.
However there is some C/AL code being called in codeunit (3-Tier Automation Mgt.) in order to both import and export the xml:
"3TierMngt".BLOBExport(BLOBRef,'*.XML',TRUE)
"3TierMngt".BLOBImport(BLOBRef,'*.xml',TRUE)
If you take a look at the import/export actions of page 9182 (Charts) you should be able to find the pieces used to import and export a single Chart definition (xml).
Hope that gets you going.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0 -
I did use the export code to create an XML port that would export all of the charts at once. The problem now is the BLOB. In the BLOB section the <brackets> are exported as escape characters. I tried the code below but get the "This Automation variable has not been instantiated." error on XMLNode as noted by others in this forum. If I CREATE XMLNode I also get an error.
IF ISCLEAR(XMLDom) THEN
CREATE(XMLDom);
Chart.CALCFIELDS(BLOB);
IF Chart.BLOB.HASVALUE THEN BEGIN
Chart.BLOB.CREATEINSTREAM(BlobInStream);
BLOBxml.READ(BlobInStream);
XMLElement := XMLDom.documentElement;
XMLNode := XMLElement.selectSingleNode('BLOBxml');
CLEAR(BLOBxml);
XMLText := XMLNode.text;
BLOBxml.ADDTEXT(XMLText);
END;0 -
I have been OOF. I will get back to you asap. Sorry for the delay.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0 -
Just realized that you might want to prefer using and XMLPort however I created a small test using actions on the page. The output from that was:
Exporting the charts from RTC can be done by adding an Export All action to the functions on the Charts (9182) page:IF ChartTable.FIND('-') THEN REPEAT ChartTable.CALCFIELDS(ChartTable.BLOB); IF ChartTable.BLOB.HASVALUE THEN BEGIN BLOBRef.Blob := ChartTable.BLOB; "3TierMngt".BLOBExport(BLOBRef, ChartTable.ID + '.XML', FALSE); END; UNTIL ChartTable.NEXT <= 0; MESSAGE('Done exporting!');
Please notice:
1) "3TierMngt".BLOBExport returns the output path for a given chart (TEMP folder).
E.g.: C:\Users\{UserName}\AppData\Local\Temp\1\Microsoft Dynamics NAV\40844
2) By specifying FALSE to the output the file is named automatically (can be confusing)!
In order to import the Chart data I did this:// TODO: Loop all xml documents in the XML folder IF "3TierMngt".BLOBImport(tempBlob,'{TEMP}\chart_(1).xml', FALSE) = '' THEN EXIT; // TODO: Find a unique ID for the Charts (based on the table id in the ChartDefinition). // TODO: Get the name from the ChartDefinition. ChartTable.INIT; ChartTable.ID := '1'; ChartTable.Name := 'Chart Import 1'; ChartTable.BLOB := tempBlob.Blob; IF ChartTable.BLOB.HASVALUE THEN ChartTable.INSERT(TRUE); CurrPage.UPDATE(FALSE); MESSAGE('Done importing!');
Let me know if you need the XMLPort way of dealing with importing the charts.
Note: I do not often look at C/AL.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0 -
henrikm wrote:Let me know if you need the XMLPort way of dealing with importing the charts.
I would be very interested if you have an easy way for importing and exporting charts all at once. I did modify the Chart Page to export all charts, but wish that they would keep their Code and Description in the name of the file, which would make importing alot easier as well.
thanks for your consideration.0 -
aseigle wrote:I did modify the Chart Page to export all charts, but wish that they would keep their Code and Description in the name of the file, which would make importing alot easier as well.
After re-reading your comment, I realized that by changing the FALSE Value to TRUE, I could preserve my Chart ID.
Is there any way to modify the import to read the name instead of using
ChartTable.ID := '1';
ChartTable.Name := 'Chart Import 1';
Thank you.0 -
how can we change the color of the charts in RTC?0
-
Maria wrote:how can we change the color of the charts in RTC?
If Yes,
Go to properties of chart and Data tab-->Edit the values
Go to Appearance tab--> Click Series Style..Go to Fill Tab and Change the Colour..0 -
You can use XMLPorts to export/import the BLOBs as follows.
Export – Create an element with SourceType – Text, TextType – BigText, and the VariableName is the name of a BigText variable. In the OnBeforePassVariable trigger, stream the BLOB into the BigText variable and then add '<![CDATA[ ' to the beginning of the variable and ' ]]>' to the end.
Import – Same thing with the SourceType, TextType, and VariableName. In the OnAfterAssignVariable trigger strip off the '<![CDATA[ ' and ' ]]>' before streaming the BigText variable out to the BLOB.0 -
Hi Guys,
I am facing some other problem, i have a database which is recently upgraded from Nav 5 to Nav 6 R2, all the charts has been deleted during the migration process, and now when i tried to import the charts from the base, import function is not working on form 9182 i.e charts....
When i click on import button it directs me to the object designer...
Is someone aware of this issue..???
PLZ help0 -
Export using SQL command BCP in command window:
bcp "[Demo Database NAV (7-0) FPack].dbo.Chart" out "C:\Temp\chart_table.bak" -T -c
Import in a new database:
bcp "[NAV-LIVE].dbo.Chart" in "C:\Temp\chart_table.bak" -T -c0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions