Dynamically assigning Header to Details Section in Map
Hi,
I need to map the details from header to details section based on the condition.
When a Batchcode matches in the header section, I need to assign the address details from header to details section in a map.
Input:
<?xml version="1.0" encoding="utf-8"?>
<Company>
<Header>
<CompanyName>ABC</CompanyName>
<IndustryType>Hardware</IndustryType>
<BranchDetails>
<Branch>
<BranchCode>ABC123</BranchCode>
<AddressLine1>street No 1</AddressLine1>
<AddressLine2>Near mmm</AddressLine2>
<city>rtere</city>
<Pincode>345678</Pincode>
<country>China</country>
</Branch>
<Branch>
<BranchCode>DEF123</BranchCode>
<AddressLine1>street no 2</AddressLine1>
<AddressLine2>Near nnnn</AddressLine2>
<city>oieroji</city>
<Pincode>8987654</Pincode>
<country>India</country>
</Branch>
</BranchDetails>
</Header>
<WarehouseDetails>
<Warehouse>
<Name>AAAAAA</Name>
<WarehouseID>987</WarehouseID>
<BranchCode>ABC123</BranchCode>
</Warehouse>
<Warehouse>
<Name>BBBBB</Name>
<WarehouseID>765</WarehouseID>
<BranchCode>ABC123</BranchCode>
</Warehouse>
<Warehouse>
<Name>BBBBB</Name>
<WarehouseID>765</WarehouseID>
<BranchCode>DEF123</BranchCode>
</Warehouse>
</WarehouseDetails>
</Company>
Expected Output
<?xml version="1.0" encoding="utf-8"?>
<Company>
<Header>
<CompanyName>ABC</CompanyName>
<IndustryType>Hardware</IndustryType>
</Header>
<WarehouseDetails>
<Warehouse>
<Name>AAAAAA</Name>
<WarehouseID>987</WarehouseID>
<BranchCode>ABC123</BranchCode>
<AddressLine1>street No 1</AddressLine1>
<AddressLine2>Near mmm</AddressLine2>
<city>rtere</city>
<Pincode>345678</Pincode>
<country>China</country>
</Warehouse>
<Warehouse>
<Name>BBBBB</Name>
<WarehouseID>765</WarehouseID>
<BranchCode>ABC123</BranchCode>
<AddressLine1>street No 1</AddressLine1>
<AddressLine2>Near mmm</AddressLine2>
<city>rtere</city>
<Pincode>345678</Pincode>
<country>China</country>
</Warehouse>
<Warehouse>
<Name>BBBBB</Name>
<WarehouseID>765</WarehouseID>
<BranchCode>DEF123</BranchCode>
<AddressLine1>street no 2</AddressLine1>
<AddressLine2>Near nnnn</AddressLine2>
<city>oieroji</city>
<Pincode>8987654</Pincode>
<country>India</country>
</Warehouse>
</WarehouseDetails>
</Company>
Please suggest a solution
Regards, Vignesh S
You can do this by using Custom XSLT:
<?xml version="1.0" encoding="utf-16"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Company">
<Company>
<Header>
<CompanyName>
<xsl:value-of select="Header/CompanyName" />
</CompanyName>
<IndustryType>
<xsl:value-of select="Header/IndustryType" />
</IndustryType>
</Header>
<WarehouseDetails>
<xsl:for-each select="WarehouseDetails/Warehouse">
<Warehouse>
<Name>
<xsl:value-of select="Name" />
</Name>
<WarehouseID>
<xsl:value-of select="WarehouseID" />
</WarehouseID>
<xsl:variable name="BranchCode" select="BranchCode" />
<BranchCode>
<xsl:value-of select="$BranchCode" />
</BranchCode>
<AddressLine1>
<xsl:value-of select="//BranchDetails/Branch[BranchCode = $BranchCode]/AddressLine1" />
</AddressLine1>
<AddressLine2>
<xsl:value-of select="//BranchDetails/Branch[BranchCode = $BranchCode]/AddressLine2" />
</AddressLine2>
<city>
<xsl:value-of select="//BranchDetails/Branch[BranchCode = $BranchCode]/city" />
</city>
<Pincode>
<xsl:value-of select="//BranchDetails/Branch[BranchCode = $BranchCode]/Pincode" />
</Pincode>
<country>
<xsl:value-of select="//BranchDetails/Branch[BranchCode = $BranchCode]/country" />
</country>
</Warehouse>
</xsl:for-each>
</WarehouseDetails>
</Company>
</xsl:template>
</xsl:stylesheet>
Morten la Cour
Similar Messages
-
Need to skip page break between header and Detail sections
Hello,
I am combining two reports in one report (one in header section and another report in the body section). when this report is run, there's a page break between these two sections. Is it possible to eliminate it? Ideally I would like the detail section to start as soon as the header section of the report is completed in the same page instead of starting (detail section report) in a new page.
Any help is highly appreciated. Thanks,
SundarI'd put them into one section to control the breaks.
-
Repeated Header Row within a Details Section Only of a Group Ignores Tablix Member Properties
Ok. I have a situation where I have a details section of a group, and I am trying to get it to repeat the row headers on each page. It's not working. I've gone into Advanced Mode, and addressed the static Tablix Member for the left-most
field of the header row in question, set the properties for the Tablix Member to "RepeatOnNewPage: True" and "KeepWithGroup: After", and still, it refuses to repeat the row header for these details. I've tried rebuilding and
not deleting the column where the grouping was originally assigned (without deleting the grouping, of course), and assigned the properties for "RepeatOnNewPage" to that left-most, grouping field, yet I get the exact same results. I've looked
up solutions, and even spoken to the expert of experts, but no joy here. I'm using VS'10.OK. So it is fixed... sort of...
Apparently, you must select to add group headers repeated as you create the group (inc. child group), BESIDES changing in Advanced Mode, Tablix Member /Properties / etc. Then you have to format that extra column within your Tablix to
make it appear to 'disappear'. BUT EVEN THEN, there is a new problem:
The headers will repeat on the additional pages, but only to a point. For some odd reason, SSRS doesn't consistently render the repeated headers of the group details for
every page, just where it is a hard (page) break, as opposed to a soft (page) break. My gut tells me that this has nothing to do with the .xml code, but is an SSRS idiosyncrasy. -
Make details section as page header
Hi ,
I have a situation where I use the sections--- Details A, Details B and Details C. I used a Fake group header as page header for Details A. How could I make Details B section as a page header (for Details C section)without repeating on the same page and repeating once on each page.
Any help please..
Thanks.Create a formula like this
@Initialize
WhilePrintingRecords;
numberVar i:=0;
place this in page header and right click on the detail section b and go to section expert and write the condition for the suppress like this
WhilePrintingRecords;
numberVar i;
i:=i+1;
if i<>1 then true
else
false
Regards,
Raghavendra -
How to combine multiple Details section rows in my report
Hello,
I am currently creating a report which will display employee details, which includes first name, last name, home phone, cell phone and Email.
I get my First Name and Last name from the "Employees" table but all other info is situated in the "CommunicationLinks" table.
The tricky part which I am having issues with is the Home Phone, Cell Phone and Email are all under the same field in this table, the field is called "DisplayAs".
These 2 tables are linked together by taking Employees.LinkID and linking it to CommunicationLinks.LinkIDParent, which are matching linkids.
The only issue that I have, is for example, if you look at the screenshot provided, I have 5 details section that gets populated for the same employee.
How can I combine all these 5 records to only one?
The homephone, cellphone and email field have formulas created for them, the formula is as follow.
This example below is for the HomePhone field, the others have different type assigned to them
If {CommunicationLinks.Type} =1 then
{CommunicationLinks.DisplayAs}
else ""
Homephone, Cellphone and Email are all different types but uses the same field "DisplayAs".
I also tried creating a subreport for each of these fields but seems to give me the same results.
Any help would be really appreciated.
If you have any other questions please let me know. See attached screenshots for reference.
Thank you in advanced.
JocelynEasier way without working in SQL:
1. Group by a field that is unique to the employee.
2. Suppress the employee group header and the details sections.
3. Create a couple of formulas:
{@ClearVariables}
WhilePrintingRecords;
StringVar HomePhone := "";
StringVar CellPhone :="";
StringVar Email := "";
Put this formula in the employee group header - even though the section is suppressed, it will evaluate.
{@SetVariables}
WhilePrintingRecords;
StringVar HomePhone;
StringVar CellPhone;
StringVar Email;
if {CommunicationLinks.Type} =1 then
HomePhone := {CommunicationLinks.DisplayAs};
else if {CommunicationLinks.Type} = <type for cell> then
CellPhone := {CommunicationLinks.DisplayAs};
else if {CommunicationLinks.Type} = <type for email> then
Email := "";
Put this formula in the details section - it will evaluate even though the section is suppressed.
{@HomePhone}
WhilePrintingRecords;
StringVar HomePhone
(Do the same for Cell Phone and Email. Note that there is no semi-colon at the end of this one!)
Put these formulas and all of the rest of the employee data in one or more Employee group footer sections.
-Dell -
Dynamic Configuration Header is Missing
Hi,
Am getting this following when I tried a simple UDF in mapping, please let me know your thoughts
"Exception caught by adapter framework: Dynamic Configuration Header is Missing."
UDF
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageProperty0");
conf.put(key1,a);
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageProperty1");
conf.put(key2,"123");
return a;
Thanks in Advance for the help
AshokHi ASHOK,
1.You will be able to see DynaicConfiguration Header automatically in Moni only if your PI is usin service Pack >= 14.in this case you jus need to check ASMA atributes in Communication channel to capture them in the UDF that you have written and need not configure the Dynamic configuration bean.To see the Service pack that you are currently using follow the navigation path.
open the PI through Log on Pad(ABAP engine) -> on the tool bar click utilities>status--> Mote details by clicking magnifying lens symbol then you will be able to see all the services packs and basis components too.
2.In case if the service pack is not SP ! >= 14 then you will have to follow the procedure of using Dyna,ic configuration Bean as experts mentioned above.
Thanks,
Ram. -
Edit box length size problem...at Detail Section.
hi.
Plz have a look on below image.
This is my problem.
in details section i put one edit box... like below..
the data is comming from data base..
Header 1
but the size of the filed is more than the size of the Edit box..
i all ready checked can grow option in format field common properties.
but horizontal line is not adjusting ....
what should i do...Hi Srini,
You can't place another object directly below an object that 'grows'.
Create another section and move the line to this new section.
-Abhilash -
Keeping heading and detail on the same page
Hi, I have a report with a group header section and a detail section. How can I keep the heading section and all the detail section on the same page without starting each group on a new page?
The detail section will have either 2 or 3 records with some of the objects set to grow if the data doesn't fit on one line. This results in several changes of group appearing on the same page which is what I want. However, what I don't want is the header section on one page with the detail section on the next, or the header and some of the detail records on one page with the rest of the detail records on the next. What I would like is the report to start a new page if the header and all the detail records don't fit on the same page but without starting a new page for every group change. How can I achieve this?you can put the group header and details into a sub report on the old group header section.
then hide the details section -
Blank space between Detail section and Page Footer - How to remove it ?
below is the problem.
We make report as followspage header Section details
Employee Information
Report Footer
Page Footer
Other Information
whenever we run this crystal report it leaves space in between after employee information (Detail Section) and before Page Footer.We don't know its a problem of footer or any other else.
When i preview and print out the reports
it showing Detail section 10 Rows (which satisfying condition) and then Blank space and then at the bottom of page shows Page Footer (which contain 2 subreports).
Let me know if you need aditional information on this.
pls provide suggestions.Try with this
1. Suppress any unused sections in both sureports and in the mainreport.
2. Check all the fields fits the sections. Select all the fields in the section and give align top and make all the fields of same height and make it fit to the section.
Hope this solves your problem. -
Multiple Details Sections in the same report
I'm trying to take two different columns from a fact table, and display them in one column on the report. So I'll then have the charge quantities (grouped and summarized) listed above the charge amounts (grouped and summarized) across months (columns).
Is there any way to have multiple detail sections in the same report, something like below? I tried sub reporting, but you can't subreport a subreport. I also tried cross tabs, but they're not flexible enough in the groupings I'm looking for.
Report Header
Group Heading 1
Details
Group Footing 1
Group Heading 1
Details
Group Footing 1
Report Footer
Thanks!!Hi,
Inorder to create new Group Header sections like Group Header a and Group Header b.There are two options
->In the design mode of the crystal reports,Rt.click on the Group Header section-Choose insert section below
OR
->From the Expert tool bar->select the Selection Expert,choose the Group Header->click insert button -
Detail section in Report Viewer Control rendered bad in IE 6/7 ???
Hi,
independent of checking the "no printer" option or select the same printer in Visual Studio Report Designer as on the deployment server the details section of Crystal Report Viewer Control is not rendered correctly in IE 6/7!!!
But looks fine in Firefox ?!?
Any ideas?
Thanks, M.
Edited by: Markus Schfer on Aug 19, 2008 9:24 AMFirst: i have to excuse me, `cause all sections (header,detail and pagefoot) are rendered strange. It seems that all data is crimped into one column on the left side?!?
I expected something like this:
Name LastName Birthday City
Value Value Value Value
etc.
But I get from IE 6/7:
Name
LastName
Birthday
City
Value
Value
Value
Value
Do you better understand my problem now ????
I hope so
Thanks a lot!
M. -
Crystal report with Details section
Dear All,
I design one Crystal report. In that can we add Details section below the Report footer.
When i add Details section it is adding below Details section like Details a and below Details b.
I want this Details b section adds below Report Footer. Can anybody suggest me how to add that is ?
Thanks and RegardsDear Friend,
Thnks for reply. In my Crystal report i added two page header like Page header a and Page header b.
In Page header a i shows the heading of columns and in Page header b also i am showing the headin column. Coz my all columns name not fited in one Page header. Tha's y i taken two Page header.
Now i also added two Details section for takeing multiple value from database. Like Details a and Details b. But it is showing one by one.
I want to show record in details section of specific column. Like following design. Can u plz tell me how to design ?
Page header a GCN/Invoice GCN ...................
Date No.
Details a 11/12/2008 1
13/12/2008 2
.........Page header b Destination Tanker
No.
Details b Pune 125469
Mumbai 566862
Thanks and Regards -
In detail section Static Text should not be repeat.
hi.
i need a small Requirement.
in detail section i put one field this is coming from data base.
beside i put one static text like something.
but something static text is repeating based on record set in detail section like
something value1
something value2
something value3
but i dont want to repeat something, only first line i need to put
like
something valu1
value2
value3
i dont want to put report section.
i need to put same line at detail section....there's a couple of ways to do this:
a) right click on the something field and choose Format Field > go to the Common tab and then select Suppress if duplicated
b) or you may wish to go to the Insert menu, choose Group, and then choose your field that contains the something. then you can right click on the Group Header name at the left of the report designer, choose Section Expert, and then choose Underlay Sections. -
Numbering To All Detail Sections
Hi,
Am developing a report in crystal report from visual studio.
I need a help.
In my report there are so many detail sections.
Example : Every record i divided into 5 parts.
One Record i divided into A,B,C,D and E
every part is in a new detail section.
Now What i need is
Record 1
1 A
2 B
3 C
4 D
5 E
Record 2
6 A
7 B
8 C
9 D
10 E
so on.....
like this i want a serial number beside every detailsection.This is not too difficult. What you'll do is group on whatever makes a record unique. Then you'll create a couple of formulas:
{@InitRowCount}
NumberVar rowcount := 0;
Place this in the report header.
{@RowCount}
NumberVar rowcount := rowcount + 1;
In each of your details sections, place a text object where you want the row number to display. Drag the {@RowCount} formula into it. Then double click the text object to edit it, place your cursor after the formula and enter the letter of the section.
-Dell -
Filling an array from a field in the details section
Hi.
I'm a Crystal newbie. I'm using Crystal 11 Dev. I have some basic understanding of programming but I am clueless as to the organization and syntax used in Crystal scripts.
Here's what I need to do. (I don't expect anyone to solve this for me, but just a starting point would be great.) I have a field in the details section, let's call it field-A. The details section is under group field, let's call it groupedField-A. For each groupedField-A there are zero to many field-A's which get looped through and displayed in the details section. Instead of just listing the values for field-A in the details section, I would like to display them in a string seperated by commas.
I figure I need to create an new array for each new groupedField-A, then add the values from field-A to the array as the details section loops through them. Then, I figure I concatenate the array values into a string in the details section or maybe the group header or footer.
Will this work in Crystal? If so, I need some help with the syntax. OR, is there another way to approach it?
Any ideas would be greatly appreciated.
Thanks
Chuck W.hey Chuck,
instead of using an array you may wish to use a string running total. an array is limited to 1000 values whereas a string running total is 64k.
details section formula:
whileprintingrecords;
stringvar srt:= srt + + ",";
group header section formula for reset:
whileprintingrecords;
stringvar srt:= "";
group foot section formula for display:
whileprintingrecords;
stringvar srt;
srt[1 to length(srt) - 1]
hope this helps,
jw
Maybe you are looking for
-
What the ****. OK, I try to change a template using Word for Mac version 14.3.4 2011 edition. I make a change to the template but am unable to save the darned thing to the template folder; it asks for a file name like it's a new document. I want to c
-
Exchange 2007 - 2010 Outlook doesn't autodiscover after mailbox move
We currently are in the process of migrating from Exchange 2007 to 2010. When I move a mailbox to 2010, Outlook (2010 in this case), fails to connect to the new environment. Restarting outlook does not help. I am forced to change the servername in
-
I have recently bought a new Cello tv which I have installed. Unfortunately Cello do not have a code which I can enter on my BT remote to allow me to control the tv and BT vision. At present my BT remote can do everything I need with the exception of
-
Stupid question! why is my PDF purple?
i have a high res PDF but i cannot remove the "varnish" so i can actually see the document it is just purple. i am sure there is a simple solution however i cannot seem to find it. please help!!!!!
-
I want to use 'Recently Added' in album view while hiding all rated albums. I do not understand why the new 'album' sort order is restricted to only a few fields, while the 'songs' sort order doesn't have the two-level; sorting that the album sort or