This is a migrated thread and some comments may be shown as answers.

Telerik report. Export to Excel. Ampersand (&) doubling.

3 Answers 149 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 2
Andrey asked on 21 Sep 2011, 10:35 AM
Hello,

  There is a text box in the report "PageHeaderSection" section.
  The text box contains following value:

   textBoxPageInfo.Value = "&P";
   textBoxPageInfo.Format = "";

  The "DefaultPageHeader" is set to "true" (page header renders into excel header):
  deviceInfo.Add("DefaultPageHeader", true);

  But after exporting in the Excel the value contains two ampersands: "&&P" (see picture).

  How can I avoid that?

  Do you have some ideas?

Thanks,
-Andrey Popov

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Sep 2011, 04:19 PM
Hi Andrey,

The ampersand is a special character in Excel’s headers and footers. For instance, if you enter the date or the time, Excel puts an ampersand before the entry. In order to show a one literal ampersand in the header or footer, two ampersands are used in excel editor. Check out Microsoft article on the topic: Use headers and footers in worksheet printouts.

Greetings,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Andrey
Top achievements
Rank 2
answered on 27 Sep 2011, 05:27 AM
Hello Peter,

  Than you for your reply.

  The "&P" is a Excel multilanguage macros which returns the page number in the header or footer (http://msdn.microsoft.com/en-us/library/bb225426(v=office.12).aspx) and I need to get it in a header.
  If I am trying two ampersands (textBoxPageInfo.Value = "&&P";) Excel shows 4 ampersands: "&&&&P", I do not need that.

  Is there a way how to export into the Excel the "&P" command (see picture)?

  Please help me with that issue.

Thanks,
-Andrey Popov
0
Accepted
Peter
Telerik team
answered on 29 Sep 2011, 04:33 PM
Hello Andrey,

The excel commands are only supported in Excel but Telerik Reporting renders reports in multiple formats. In this line of thoughts specific functionality dedicated to one rendering extensions such as VBA codes/commands are not supported.

Regards,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Andrey
Top achievements
Rank 2
Answers by
Peter
Telerik team
Andrey
Top achievements
Rank 2
Share this question
or