Print Page | Close Window

Crystal report goes blank

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4557
Printed Date: 09 May 2024 at 4:32am


Topic: Crystal report goes blank
Posted By: melanie
Subject: Crystal report goes blank
Date Posted: 16 Oct 2008 at 9:09am
Hi, I have a crystal report that looks like the periodic table. When I click one of the "squares" it opens another crystal report with more details. This is working fine and has been for months. Now I have been asked to add an enhancement which will place a hyperlink in the second report that will open a document (.txt, .pdf, or.doc) which has been attached to that record from another page in our web app.
 
I created a hyperlink field on the report and in the formula editor for the supress property I typed the following:
 
if not isnull, ({CARS_REPORT_AGENT_SUPPORT_CALLS_DETAIL.ATTACHMENT_ID}) and {CARS_REPORT_AGENT_SUPPORT_CALLS_DETAIL.ATTACHMENT_ID} > 0 then
   {?paramURL} +  "GetAttachment.aspx?attachmentId=" + Cstr({CARS_REPORT_AGENT_SUPPORT_CALLS_DETAIL.ATTACHMENT_ID})
 
(Not all records have attachments)
 
Then in the GetAttachment file the following will open the file after getting a blob from the database using the attachment id (.NET C#):
 

Response.BinaryWrite((byte[])dr["FILEATTACHMENT"]);

Response.AddHeader("Content-Disposition",

String.Format("attachment; filename={0}", fileName));

The attachment opens great. The problem is after I close it, both my reports go blank. I can select the report window and hit F5 and the report will refresh correctly, but obviously, I can't give it to the client like this.

Any suggestions are appreciated. Hope you are all having a good day.



Print Page | Close Window