cancel
Showing results for 
Search instead for 
Did you mean: 

Can Grow Vertical Alignment Error in Embedded Report View, but not in .PDF

Former Member
0 Kudos

Hello,

I have seen postings about this issue before, but have yet to find a solution.

I am using Visual Studio 2008 w/ the basic version of Crystal Reports that is included.

I have a simple report that displays results of a stored procedure as rows across the report. One field can be of variable length, anywhere from 0 to 100 characters. Usually it's something reasonable (less than 40 chars), and so I have only given it so much width in the report. For when it is longer than that, I turned the "Can Grow" property ON, and set the Maximum Number of Lines property to 0.

When the report displays embedded in my Web Form, and this field's data is wider than the space I have allowed, it breaks the data down into multiple lines of the same correct width, as you'd expect, but those lines end up displaced vertically upward several rows, and print directly on top of other data from the above rows, make the report unreadable in that area (and quite ugly overall!).

If I export this report to a .PDF, it displays perfectly, without the vertical displacement error.

Anyone know what the official work is on this? Is there a fix or is this a bug?

If there is no fix, does anyone know how to direct the report to the .PDF file viewer, so the embedded report remains invisible (and thus hides the ugly error), but the user has the .PDF version to see? My client ultimately wants to export the report to .PDF, which I have already coded, but it does not open the .PDF Viewer, just saves the report to disk. However, if I use the Crystal built-in Export button, it first displays a pop-up asking which format to export to, then if .PDF is chosen and okay is clicked, the pop-up switches to contain the .PDF Viewer, and opens the report. In my user-defined export code, the .PDF is correctly created, but I am missing the step on how to open the .PDF Viewer.

Any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Scott;

Try putting the field into it's own section in the report. Ie, create a new details section just for that field, it will be Details B, and should then force any text to move down as expected.

Regards,

Jonathan

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

To send the report to the PDF viewer, see this thread:

First thing

https://forums.sdn.sap.com/click.jspa?searchID=16644362&messageID=5953965

You may also want to search the forum for other threads. When I looked, there was at least a page of posts on how to, etc., etc.

Ludek

Former Member
0 Kudos

Thanks for the responses.

Jonathan, moving the field in question to its own details section (details B) did not fix the issue. The field in question is moved slightly down as its in a new details section with sits slightly lower than details A, but when it has to be broken up into multiple lines, the same issue arises, the field text is displaced vertically upward and sits on top of other data.

Ludek, I wanted to send the report to a .PDF Viewer in a new browser, and keep the original browser intact. I'm using code very similar to yours. To launch the new broswer I added this code to the Page_Load of my main browser:

btnViewReport.Attributes.Add("onclick", "window.open(Page.aspx', """", """", 'height=200,width=400')")

When the button is clicked the report is exported, and the new browser opens Page.aspx.

I use this code in Page_Load of Page.aspx:

Dim webClient As System.Net.WebClient = New System.Net.WebClient()

Dim buffer As Byte() = webClient.DownloadData("C:\Reports\Report.pdf")

If Not buffer.Length.Equals(0) Then

Response.ContentType = "application/pdf"

Response.AddHeader("content-length", buffer.Length.ToString())

Response.BinaryWrite(buffer)

End If

Any other ideas on the original vertical displacement issue when using Can Grow, I'd still appreciate it.

Thanks,

Scott

Edited by: Scott Deltorto on Sep 23, 2008 10:15 PM