We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Template Markers - multiple rows

Hi,

I am attempting to use Template Markers, but have come into a problem.

Imagine an Excel sheet, where each customer should have the following listed:

Company Name | Contact Name
Address

I have been unable to get the Template Markers to do something like this. I want the template to copy those two lines (3 fields) down, for each customer in the dataset.

I hope you can help me with this.

Best Regards
Casper Bang


10 Replies

GM Geetha M Syncfusion Team October 29, 2008 11:17 AM UTC

Hi Casper,

Thank you for your interest in Syncfusion products.

I was not able to reproduce the problem. Could you please try running the below sample and reproduce it if you still face the issue?

http://websamples.syncfusion.com/samples/XlsIO.Windows/F77331/main.htm

Regards,
Geetha



AD Administrator Syncfusion Team October 30, 2008 07:12 AM UTC

Hi,

The example you are referring to is not what I had in mind.
That example only shows data on one line for each record - I want the data on two (or more) lines for each record.

If you, in the example you referred to, wanted to have the address on a row directly below the company name.
How would you do something like that?

With the data from your sample, the first few rows would look like this:


[Row 1] Alfreds Futterkiste | Maria Anders
[Row 2] Obere Str. 57
[Row 3] Ana Trujillo.....

I hope this better explains the result I am looking for.

Best Regards
Casper Bang



GM Geetha M Syncfusion Team October 31, 2008 12:30 PM UTC

Hi Casper,

Thank you for the details.

I am working on creating a sample similar to your requirement. I will get back to you on Monday.

Regards,
Geetha



GM Geetha M Syncfusion Team November 3, 2008 12:13 PM UTC

Hi Casper,

Please try using the following codesnippets:

sheet.Range["A5"].Text = "%Customers.CompanyName;jump:R[2]C";
sheet.Range["B5"].Text = "%Customers.ContactName;jump:R[2]C";
sheet.Range["A6"].Text = "%Customers.Address;jump:R[2]C";

This will generate the file as per your requirement. Here, '2' refers to number of rows (there will be two rows).

You can get the sample from the below link:
http://websamples.syncfusion.com/samples/XlsIO.Windows/F77331/main.htm

Please let me know if you have any questions.

Regards,
Geetha



AD Administrator Syncfusion Team November 4, 2008 10:04 AM UTC

Hi,

Thank you very much for your help so far. It works great in your example.

Unfortunately, there is one thing I didn't mention (I did not think of it as an issue). Below all the inserted record, there should be some static values - the method you show, does not push down the rows.
I have tried to use the "insert" and "insert:copystyles" argument, but that just results in exceptions being thrown.

I have attached a new template, so that you can see what I mean. The red field should be pushed down, as rows are inserted (in my case, some of the rows being pushed down will also be template-fields, but I assume that will not make a difference in this case).


I am sorry for asking all these questions. Usually the documentation from Syncfusion is great, but my knowledge in Excel is perhaps too shallow for me to understand your documentation on arguments for template markers.

Thank you very much in advance for your help.

Best Regards
Casper Bang



TemplateMarker_fb740a00.zip


GM Geetha M Syncfusion Team November 5, 2008 07:28 AM UTC

Hi Casper,

Thank you for the details.

If your intension is to insert the records without overriding the static values, then you may have to increment the value as 3.

sheet.Range["A5"].Text = "%Customers.CompanyName;jump:R[3]C";
sheet.Range["B5"].Text = "%Customers.ContactName;jump:R[3]C";
sheet.Range["A6"].Text = "%Customers.Address;jump:R[3]C";

You can check the sample in the below link:
http://websamples.syncfusion.com/samples/XlsIO.Windows/V2_F77331/main.htm

Please let me know if this does not meet your requirement.

Regards,
Geetha



AD Administrator Syncfusion Team November 5, 2008 08:39 AM UTC

Hi,

Thank you for your response.
The intention is to move the static text down, so that it appears below the inserted line.

For a regular one-line template, I would have used "insert:copystyles", but if I do so here, it will not work.

Is it at all possible to do that?

Best Regards
Casper Bang



GM Geetha M Syncfusion Team November 6, 2008 12:36 PM UTC

Hi Casper,

I am not sure if I understood the requirement clearly.

insert:copystyles copies the styles from above or left column. This argument must be used in conjunction with the marker which would copy the styles.

Please go through the documentation in the below link:
Template Markers

As given in the document, the style of the "%Customers.CompanyName;insert:copystyles" will be copied to the succeeding rows.

Kindly let me know if you have any questions.

Regards,
Geetha



AD Administrator Syncfusion Team November 6, 2008 12:49 PM UTC

Hi,

Thank you for your support.
I did not find that link myself when I looked for examples on template markers - I believe it will provide me with a better understanding of the subject.

Thank you for your patience and your help.
Casper Bang



MM Manikandan M Syncfusion Team August 30, 2012 07:28 AM UTC

   

Hi Casper,

We are sorry for the delay in getting back to you.

We have provided the link for online documentation of template marker below.

 http://help.syncfusion.com/UG/Reporting/XlsIO/ASP.NET/default.htm#!documents/templatemarkers.htm


Thanks for your patience. Kindly let me know if you have any questions.

 

Regards,

Manikandan.M


Loader.
Live Chat Icon For mobile
Up arrow icon