Report design for hierarchical xml data
I need to create a report that shows hierarchical xml data. I already have an xml saved to a database. How would I go bout creating a design for such a report? Should I be doing groups on every parent with children? Any example?
Thanks
Hi markgoldin,
I tested the issue in my local machine by following steps:
1. Created a table and store the xml into the table with the following query:
CREATE TABLE xmlTbl (id INT, xmlVal xml);
INSERT INTO xmlTbl values(1,
'<Customers>
<Customer ID="11">
<FirstName>Bobby</FirstName>
<LastName>Moore</LastName>
</Customer>
<Customer ID="20">
<FirstName>Crystal</FirstName>
<LastName>Hu</LastName>
</Customer>
</Customers>'
2. Created a stored procedure to retrieve data from the table with the following query:
create procedure xml_report
as
DECLARE @xmlDoc XML;
SELECT @xmlDoc = xmlVal FROM xmlTbl WHERE id=1;
SELECT T.c.value('(@ID)','int') AS ID,
T.c.value('(FirstName[1])','varchar(99)') AS firstName,
T.c.value('(LastName[1])','varchar(99)') AS lastName
FROM @xmlDoc.nodes('/Customers/Customer') T(c)
GO
3. In the Report Data pane, right-click Data Sources and click Add Data Source.
4. For an embedded data source, verify that Embedded connection is selected. From the Type drop-down list, select a data source type; for example, Microsoft SQL Server or OLE DB. Type the connection string directly or click Edit to open the Connection
Properties dialog box and select Server name and database name from the drop down list.
5. For a shared data source, verify that Use shared data source reference is selected, then select a data source from the drop down list.
6. Right-click DataSets and click Add Dataset, type a name for the dataset or accept the default name, In Data source, select the name of an existing shared data source, select StoredProcedure in Query type, then select xml_report from stored procedure
name drop down list.
7. In the Toolbox, click Table, and then click on the design surface.
8. Drag the Date field from the dataset to the cells in the table.
The following screenshot is for your reference:
For more information about how to use the xml data type methods, please refer to the following document:
http://msdn.microsoft.com/en-us/library/ms190798.aspx
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
Similar Messages
-
Designing a 'sample time feed' for Spry XML Data Set
Hi!
Often when I call a Spry XML Data Set I find I can't get the
schema. If offers you the option to design a sample time feed but
doesn't give you enough info to be able to even guess how to do
this.
Is the answer in modifying that php line somehow?
Any guidance would be much appreciated!
MikeThe idea for Design Time XML is that you can use a static XML
file instead of a dynamic source, in case you don't have access to
the real data. You can use the Design Time XML to make the query
and design the page.
This gives you access to the data references for designing
the page.
If you are getting schema errors, the numbers that the dialog
shows is the line number and character number (1,1)
You should be able to see the XML directly in the browser. If
you can, then DW should be able to consume it. -
Bex Report Designer - Large amount of data issue
Hi Experts,
I am trying to execute (on Portal) report made in BEx Report Designer, with about 30 000 pages, and the only thing I am getting is a blank page. Everything works fine at about 3000 pages. Do I need to set something to allow processing such large amount of data?
Regards
VladimirHi Sauro,
I have not seen this behavior, but it has been a while since I tried to send an input schedule that large. I think the last time was on a BPC NW 7.0 SP06 system and it worked OK. If you are on a recent support package, then you should search for relevant notes (none come to mind for me, but searching yourself is always a good idea) and if you don't find one then you should open a support message with SAP, with very specific instructions for recreating the problem from a clean input-schedule.
Good luck,
Ethan -
Create Report with CR4E and XML Data Source
Hi all,
I have a problem when create a report with CR4E that should use a XML data source. It is not possible to choose fields from the field explorer, because ther are no fields from the XML-file. Is there a general problem when using an ODA data source in CR4E? At the moment I can only create reports with a database as data source.
Please help me with a tip.
Thanks
ArnoldHi,
After Installing CR4E Version 2 the code snippet for creating a XML-report not works as JSP. Has anywhere a hint to resolve the problem or a complete JSP-file?
reportClientDocument = new ReportClientDocument();
java.lang.NoClassDefFoundError: com/crystaldecisions/reports/common/data/CrystalResultSet
com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.<init>(Unknown Source)
org.apache.jsp.XMLDataSource_jsp._jspService(XMLDataSource_jsp.java:64)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Thanks
Arnold Meier -
Using oracle reports designer can we export data to excel sheet
using oracle reports designer can we export oracle data to excel sheet
There is a big discussion on this topic in the following link. I think you might be helpfull .
The link is:
A newbie question for a newbie user
Regards
Samujjwal Basu -
Generate hierarchical xml data with xmlutilities ?
hello
I am just experimenting with the oracle xml utilities, because I
want to set on http-services to access to our patient database.
Is it possible to generate the following xml structure (ALL
relevant diagnoses are hierarchically subordered to the ONE
patient) when two tables (master table patient, dependent table
diagnoses) are given ?
<rowset>
<row num=...>
<name>smith</name>
<diagnosis>
<date> ...</date>
<icd-code> ... </icd-code>
<text> ... </text>
</diagnosis>
/*ev.further diagnosis*/
</row>
/*ev.further rows for further patients*/
</rowset>
By the moment, I have the impression that only list-similar xml
data is possible.
Thank You very much for comments.
ali gerhard
nullHi ali,
Yes, you can use the CAST(MULTISET()) operator to create a
nested table of subordered diagnostic record and display it.
(You need the objects option installed if you are using 8.0.
With 8i, the objects options is included free)
e.g.
/* Create a regular type */
CREATE TYPE diagnostic_type AS OBJECt
diag_date NUMBER,
icd_code NUMBER,
/* etc... all the necessary diagnostic details.. */
/* create a nested table type */
CREATE TYPE diagnostic_list_t AS TABLE OF diagnostic_type;
/* Now u can use this in any query */
SELECT p.name AS name,
CAST(MULTISET( SELECT d.diag_date, d.icd_code,...
FROM diagnosis_table d
WHERE d.patient_name = p.name)
AS diagnostic_list_t) AS diagnosis
FROM patient_table p;
This query as u can see gets the name of the patient and then
creates a nested table of diagnostic records for the patient.
This assumes that for every patient there are more than 1
diagnosis records.
If you have only one diagnostic record per patient then u can
simply write this as,
SELECT p.name AS name,
diagnostic_t(d.diag_date,d.icd_code,...) AS diagnosis
FROM patient_table p, diagnostic_table d
WHERE p.name = d.patient_name;
Here u are just constructing a structured diagnosis type from
the given values.
Hope this helps,
Murali
ali gerhard (guest) wrote:
: hello
: I am just experimenting with the oracle xml utilities, because
I
: want to set on http-services to access to our patient
database.
: Is it possible to generate the following xml structure (ALL
: relevant diagnoses are hierarchically subordered to the ONE
: patient) when two tables (master table patient, dependent
table
: diagnoses) are given ?
: <rowset>
: <row num=...>
: <name>smith</name>
: <diagnosis>
: <date> ...</date>
: <icd-code> ... </icd-code>
: <text> ... </text>
: </diagnosis>
: /*ev.further diagnosis*/
: </row>
: /*ev.further rows for further patients*/
: </rowset>
: By the moment, I have the impression that only list-similar
xml
: data is possible.
: Thank You very much for comments.
: ali gerhard
null -
Newbie question on report design for multiple pages - HELP!
I am upgrading an existing accounting program to use Crystal reports. The accounting program generates account statements for our investors. Each account needs to have 1 statement (which typically is only 1 page long).
I have a table that has 1 record per activity per account. Every account has a unique code and the report is set to group records by this code. Therefore, an account can have 1+ records associated with it that need to be displayed in the details section.
To test my report I have 4 records in my table -- 2 records for account code 'ABCD' and 2 records for account code 'WXYZ'. The report correctly groups the records together and summarizes the necessary information, but it DOES NOT create a page break.
I don't understand what else I need to do in the designer to force it to create a new page everytime the account code changes... It's basically a mail-merge type functionality that I am looking for!
Any help is appreciated.
SGIn the gray section to the left of the report design, right-click on the group footer for the Account Code and select 'Section Expert'. Turn on "New Page After". To prevent a blank page at the end of your report, click on the formula button to the right of the check-box and enter "not OnLastRecord".
-Dell
- A computer only does what you told it to, not what you <em>thought</em> you told it to! -
Script for parsing xml data and inserting in DB
Thank you for reading.
I have the following example XML in an XML file. I need to write a script that can insert this data into an Oracle table. The table does not have primary keys. The data just needs to be inserted.
I do not have xsd file in this scenario. Please suggest how to modify Method 1 https://community.oracle.com/thread/1115266?tstart=0 mentioned so that I can call the XML mentioned below and insert into a table
Method 1
Create or replace procedure parse_xml is
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
l_file dbms_xmldom.DOMNodeList;
l_filen dbms_xmldom.DOMNode;
lv_value VARCHAR2(1000);
l_ch dbms_xmldom.DOMNode;
l_partname varchar2(100);
l_filename varchar2(1000);
l_temp VARCHAR2(1000);
TYPE tab_type IS TABLE OF tab_software_parts%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
l_bfile := BFileName('DIR1', 'SoftwareParts.xml');
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => l_clob, src_lob => l_bfile, amount => dbms_lob.getLength(l_bfile));
dbms_lob.close(l_bfile);
dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY''');
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/PartDetails/Part');
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
t_tab.extend;
dbms_xslprocessor.valueOf(l_n,'Name/text()',l_partname);
t_tab(t_tab.last).partname := l_partname;
l_file := dbms_xslprocessor.selectNodes(l_n,'Files/FileName');
FOR cur_ch IN 0 .. dbms_xmldom.getLength(l_file) - 1 LOOP
l_ch := dbms_xmldom.item(l_file, cur_ch);
lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_ch));
if t_tab(t_tab.last).partname is null then t_tab(t_tab.last).partname := l_partname; end if;
t_tab(t_tab.last).filename := lv_value;
t_tab.extend;
END LOOP;
END LOOP;
t_tab.delete(t_tab.last);
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
if t_tab(cur_emp).partname is not null and t_tab(cur_emp).filename is not null then
INSERT INTO tab_software_parts
VALUES
(t_tab(cur_emp).partname, t_tab(cur_emp).filename);
end if;
END LOOP;
COMMIT;
dbms_xmldom.freeDocument(l_doc);
EXCEPTION
WHEN OTHERS THEN
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;
<TWObject className="TWObject">
<array size="240">
<item>
<variable type="QuestionDetail">
<questionId type="String"><![CDATA[30]]></questionId>
<questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
<country type="String"><![CDATA[GB]]></country>
<questionText type="String"><![CDATA[Please indicate]]></questionText>
<optionType type="String"><![CDATA[RadioButton]]></optionType>
<answerOptions type="String[]">
<item><![CDATA[Yes]]></item>
<item><![CDATA[No]]></item>
</answerOptions>
<ruleId type="String"><![CDATA[CRP_GB001]]></ruleId>
<parentQuestionId type="String"></parentQuestionId>
<parentQuestionResp type="String"></parentQuestionResp>
</variable>
</item>
<item>
<variable type="QuestionDetail">
<questionId type="String"><![CDATA[40]]></questionId>
<questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
<country type="String"><![CDATA[DE]]></country>
<questionText type="String"><![CDATA[Please indicate]]></questionText>
<optionType type="String"><![CDATA[RadioButton]]></optionType>
<answerOptions type="String[]">
<item><![CDATA[Yes]]></item>
<item><![CDATA[No]]></item>
</answerOptions>
<ruleId type="String"><![CDATA[CRP_Q0001]]></ruleId>
<parentQuestionId type="String"></parentQuestionId>
<parentQuestionResp type="String"></parentQuestionResp>
</variable>
</item>
</array>
</TWObject>Reposted as
Script to parse XML data into Oracle DB -
Help required in building up the Java Bean for an XML data
Hi ,
I want to build a Java bean which will actually represent an xml data . The class will be named as User and it will typically represent the data in the follwing xml:
<user>
<cwsId>barbete</cwsId>
<firstName>William</firstName>
<lastName>Barber</lastName>
<status>true</status>
<role>
<roleCode>1000000177</roleCode>
<roleName>Customer Administrator</roleName>
</role>
<language>en</language>
<country>US</country>
<preferences>
<equipmentGroup>2717</equipmentGroup>
<dateFormat>MON-dd-yyyy</dateFormat>
<timeFormat>HH:MI AM</timeFormat>
<timeZone>-12:00</timeZone>
<daylightSavings>Y</daylightSavings>
<location>NC</location>
<recordsPerPage>10</recordsPerPage>
<historyPeriod>3</historyPeriod>
<distanceUnit>MILE</distanceUnit>
<fuelUnit>G</fuelUnit>
<unitIdDisplay>E</unitIdDisplay>
<smuUpdate>W</smuUpdate>
<countries>
<country>
<countryCode>GB</countryCode>
<countryName>UNITED KINGDOM</countryName>
</country>
<country>
<countryCode>US</countryCode>
<countryName>UNITED STATES</countryName>
</country></countries>
</preferences>
</user>
Now for single child nodes like cwsId of the main user node i have kept properties like
private String cwsId;
But i am not sure as to how to represent the nodes which contain subnodes like "preferences"node. Any ideas?What is the standard practice?One thing you could do is create an object model first, which will contain all the data for your user.
then all you need in the bean is a Hashtable with the name of the user as a key, and the user-object (which is actually the complete object model) as a value.
with the XML stated by you, you would get an object model something like this:
Class User
String cwsid;
String firstName;
ArrayList<Role> roles = new ArrayList<Role>(); //I'm assuming a user can have more then one role.
ArrayList<Country> countries = new ArrayList<Country>();
class Role {
String code;
String name;
class Country {
String code;
String name;
}And so on for all the varioous elemets of your XML. -
How to set a report culture for number and date
Hi,
Is there a way to change the report locale for the number and date?
I've tried using both CrystalDecisions.Share.SharedUtils.RequestLCID and CrystalReportViewer.SetProductLocale and neither work
The only one that work is to use the Thread.Culture. But that also change the application culture, not just the report.
Anyone have a solution?
ThankHi Michel,
I don't believe you can do this within just the report itself but I haven't played with this very much. Because the App hosts the Viewer it's based on it's culture.
You should be able to mix if you create a separate thread for each report job that way they are in their own space.
Search the Object browser on celocale and you'll find more info. Also the SDK help file should have examples.
No API's to use the Engine, had to use RAS.
Need to know what version you are using also and WEB or Windows app?
Here are some samples using RAS:
rpt1.ReportClientDocument.LocaleID = CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleGerman;
CrystalDecisions.ReportAppServer.DataDefModel.CrFieldDisplayNameTypeEnum.crFieldDisplayNameFormula, CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleUserDefault);
And using this way you may have to alter every object in the report.
Thanks
Don -
Correction for Nested XML Data Sample
I found an error in the sample code on the
Nested
XML Data Sample under "Using Nested Data Sets." Line 8 has
var dsToppings = new Spry.Data.NestedXMLDataSet(dsItems1,
"toppings");, but it should be
var dsToppings = new Spry.Data.NestedXMLDataSet(dsItems1,
"topping"); in order to match the XML file.
Another suggestion for us newbies would be to have the
samples start with a comment about any additional scripts we need
to insert into our files. It took me a long time to realize I
needed to include
<script type="text/javascript"
src="scripts/SpryNestedXMLDataSet.js"></script> with
the others in the head.
Thanks for your work!
JonathanHi Jonathan,
Thanks for catching that. I corrected the doc and the change
will appear when we release 1.5.
Also, regarding <script> includes sample, yes, we
should definitely be doing that.
Thanks!!!
--== Kin ==-- -
Using XSU for Storing XML data
Please how can I use the XSU API for storing XML documents in Oracle8i? I know part of the code to store a document but how do I import the XSU API?
Do I have to download it or use it via Oracle?
example:
String xmlDoc = "my_xml_document";
Connection conn = >>DriverManager.getConnection(...);
OracleXMLSave sav = new OracleXMLSave
(conn,"purchaseOrderTab");
sav.insertXML(xmlDoc);But how do I use OracleXMLSave? How do I import the XSU API?
thanks for your help
nullWhat is XSU? I think you question should be posted at the XML or XDK forum.
-
Format URL for Spry XML Data Set
I've searched and searched the forums to no avail, but please
link me to the solution if already posted.
I want to create a Spry data set where one of the fields is
simply an URL such as:
<name><a href="
http://www.aim-us.org/">African
Inland Mission</a></name>
I want the name to appear in the list as a hyperlink. I'd
sincerely appreciate anyone straightening me out on the correct XML
format to accomplish this. Thanks!The idea for Design Time XML is that you can use a static XML
file instead of a dynamic source, in case you don't have access to
the real data. You can use the Design Time XML to make the query
and design the page.
This gives you access to the data references for designing
the page.
If you are getting schema errors, the numbers that the dialog
shows is the line number and character number (1,1)
You should be able to see the XML directly in the browser. If
you can, then DW should be able to consume it. -
Report/Widget for combined performance data
Hello.
I have created a dashboard view in SCOM 2012 R2 for power consumption of a number of servers. These servers are all part of a group. The power consists of a couple of different performance monitors (VMWare-sensor for VMs and Power Meter from the Power
Consumption MP)
The dashboard view works well, however I am after a total figure for each server in the group. Ideally this figure would be on the dashboard view as well.
E.g. if I have 3 servers with the below power draw
Server 1 – 150 Watts
Server 2 – 200 Watts
Server 3 – 300 Watts
I would like a box stating total power 650 Watts
If this is not available in a dashboard view, a report would be okay
ThanksHi,
As far as I know, there is no direct way, you may create a sql query and sum the value for each server.
You may refer to the helpful article below:
http://blogs.technet.com/b/drewfs/archive/2014/08/17/scom-performance-data-and-power-view.aspx
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
SSRS report design for local processing mode
I use SSRS, SQLSERVER 2012 and VS2012. Does anyone know whether there is a way to design the report without going through the report wizard or attaching using the binding source objects that you drag and drop and the datasets that you drag and drop
etc.
I found this on the Internet
Dim DSReport As New ReportDataSource()
DSReport.Name = "YourDataSetName"
DSReport.Value = "YourDataSetName.Tables[TableIndexOrName]"
Dim PathReport As String = "PATH_TO_YOUR_REPORT"
_ReportView.LocalReport.ReportEmbeddedResource = PathReport
_ReportView.LocalReport.DataSources.Clear()
_ReportView.LocalReport.DataSources.Add(DSReport)
_ReportView.LocalReport.Refresh()
_ReportView.RefreshReport()
Until I find a better way, I go though the painstaking process of creating dataset, datasource, connection etc and then invoke the report with code such as the following:
Public Sub New()
MyBase.New()
InitializeComponent()
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = "../../report/rpt1.rdlc"
' Dataset name is Case sensitive
Dim datasource As New ReportDataSource("dst1", GetReportCustomers())
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(datasource)
End Sub
Private Function GetReportCustomers() As DataTable
Dim dtb As DataTable = fungGetWorkLog(1068).Tables(0)
GetReportCustomers = dtb
End Function
I hope that someone has a better idea as to how to design SSRS reports than what I indicate above.
Many thanks in advance,JohnHi JohnPapa05,
According to your description, you want to design report directly without specifying data source and dataset. Right?
In Reporting Services, we don't recommend circumvent creating data source and dataset. Because Reporting Services is working on retrieve data -> process data -> render data. Even we can create some items (like textbox) without creating
data source and dataset, but there is no significance if we design a report without data. Since you want to achieve this goal by using VB code. We suggest you post this thread on VB forum:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral
Best Regards,
Simon Hou
Maybe you are looking for
-
Plan/Actual Version Data I have a query that shows plan and actual sales figures on monthly basis. Plan and actual data is identified by 0VERSION (P1 for Plan; P0 for Actual). 0CALMONTH and Sales key figure is in rows. 0VERSION is in collums. The out
-
My face info disappeared after iPhoto upgrade...?
I'm not sure which upgrade it was--did not look at the face info recently--but all my work at identifying them seems to be gone.
-
hi i done the confirmation as 4 yield and 1 scrap in co11n,then i clicked on goodsmovemnt tab ,on goodmovemnt screen on posted scrap qty on different material with 531 movemnt type and i have given reason for movment on same screen,when i tries to c
-
Dashboard Appears On Screen Randomly
I just purchased a iMac G5 isight. The dashboard appears out of nowhere when I am performing other tasks. I was just trying to send a group e-mail and when I clicked on "add" at the bottom of the list the dashboard appeared. That happened 3 times, af
-
Hi SRM guru's, I am unable to receipt an order. When I click the confirmation button the screen refreshes back to the original screen. The confirm screen does not appear. Please help me out