1
votes

So, I have a local .rdlc file with some text formatted using strikethrough formatting. My issue is quite simple to explain, but I do not know if it is just a limitation of PDF, or a bug with the .rdlc exporting to PDF.

When I write this code:

var localReport = new LocalReport();
...
byte[] pdf = localReport.Render("PDF");
System.IO.File.WriteAllBytes("MyReport.pdf", pdf);

None of the strike-through formatted text transfers over the the .pdf file properly.

If instead, I export to Word using .Render("Word"), the strikethrough does work on the .doc format. So, I know it isn't a problem with the .rdlc report itself.

Has anyone encountered this? Any solutions or workarounds?

2
I just tested in BIDS 2008R2 and the exported PDF contained the strike through. What version are you using? - Jamie F
Jamie, I am on SQL Server 2008, but not R2. Maybe upgrading will be a fix. - Linus
I didn't test extensively: I just used the export to PDF built in to BIDS and had success. I just added an answer with links to a discussion of this from a couple years ago. - Jamie F

2 Answers

1
votes

I found this: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/b35ca474-046d-4a38-a765-6c38c3d33105/ which suggests that missing strikethrough in PDFs was a known limitation. (But as mentioned in comments to the question, I couldn't reproduce with 2008r2.)

The two workarounds given there look painful.

(A) finding a font which itself as the strikethrough built into each glyph/character. (B) trying to mimic a strikethrough using a line report item. Note that for (B) overlapping items are supported only in PDF, Print & TIFF formats.

I suppose if it were mine, I would play around with option B if the text is a small amount. Also, it may be worth test some of the html passthrough enabled when a placeholder is set to render as HTML. Maybe using a strikethrough style there would work?

1
votes

While exporting RDLC report on word, I faced this issue. So while fetching data I replaced style for Strike formatting with strike tag from HTML and it worked.