I’m attaching a sample output file and my template so you can see me issue. I have a template with a static area of merge fields at the top of the document. I then have 2 areas (callbacks and relationships) both wrapped in mergefield with start and end areas. My issue is, the callbacks and relationships areas should only load for the records which are responsible for each person. Each area is loading all records in the table for each person. In the example I attached, each person has one relationship and one callback, but you can see it put them both on each.
Thanks for your inquiry.
Could you please try debuging your code and check the contents of the dtTemplate2 and dtTemplate3 DataTables at runtime? I believe they most likely contain both entries, which points to a problem with the queries you are making to the database. If this is not the case could you please post your datasource that you are using for testing here?
You may also want to look into nested mail merge as described here. This could help you with what you are looking to do.
Yes, my datasets are loading all data for all records. That example you provided me used XML and XML relationships. I’m not using an XML datasource. Where can I define my relationships for each dataset? If I change the dataset to only get one, then it will miss the others. Do I have to loop through the table manually and run the region merge each time?
I really cannot figure this out so I decided to just generate an XML file and populate from that. How do I deal with inserting a picture from an XML file?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your inquiry.
1. No, you do not need to loop through the table manually and execute mail merge for each record. You should just use DataSet as data source for mail merge.
2. Please follow the link to learn how to insert images during mail merge:
You can use the same technique to insert images from XML.
Thanks for this additional information.
Setting up a relation in XML and from a database is the same thing as both are being loaded into a DataSet object. When loading from XML the relations were automatically inferred from the structure, when loading from a database you may need to manually set your data relations.
Please see this post here which shows an example of how to set multiple relations between a table in a DataSet.
If you have any further troubles, please feel free to ask.
Thankyou for that link. I was almost done using string writer and spitting all my table info into XML format to then mimick your XML example. That post enabled me to do the following which is working just fine… Your support is what pushed me over the edge and I have after 30 days of playing with the product made the purchase. I love the product and the support response time! 19xx well spent IMO…
’, CHAR(13)) AS CommunicationMemo FROM ViewCommunication INNER JOIN ExportDetail ON ExportDetail.ExportPrimaryRecordID = ViewCommunication.PrimaryRecordID WHERE CommunicationActiveYNTxt <> ‘No’ AND PrimaryRecordID<>‘0’ AND ExportDetail.ExportID=’” & Request.QueryString(“ID”) & “’ order by CommunicationCreatedDate desc”, myConnection)
Thanks for that postive feedback regarding Aspose.
If you have any further inquiries, please feel free to ask.