Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report /Dataset/PDF with ASP

Status
Not open for further replies.

Bensta

Programmer
Jul 21, 2003
122
US
Hello everyone.
Has anybody run into this error message before?
When I try to view the reports from my ASP.net application on the production server I get this error:
Error in File: C:\Windows/Temp/temp_051f79e6-ede8-4f90-ac9ad7555b51.rpt: Page header or footer longer than a page

Exception Details: CrystalDecisions.CrystalReports.Engine.FormatingException: Error in File C:\Windows/Temp/temp_051f79e6-ede8-4f90-ac9ad7555b51.rpt: Page Header or Footer longer than a page.
I am using the push methods to generate the reports along with the ReportDocument object control: However I convert the report into PDF format prior to displaying the report in the browser; This works just fine on my test environment machine, but not on the production environment: I followed all the steps for deploying Crystal Reports with ASP.net, and still I am getting this error.
Can anyone help me here please? I would really appreciate it
Bensta
 
Hi dvannoy
Yes, I believe I deployed the project correctly: I followed all the steps. I included all the merge modules.
Here is the code I use to convert the report to pdf format: Just a quick question: Should the crystal reports be visible on the application root directory once the app is deployed?
Also I am using the ReportDocument Control instead of the CrystalReportViewer control. It is not strongly-typed report.
From the load_page event:
Dim myConnection As SqlConnection

myConnection = New SqlConnection(ConfigurationSettings.AppSettings("Connection").ToString)


Dim da As New SqlClient.SqlDataAdapter( _
"uspTicketOver60Days", myConnection)
'Dim ds As New TicketsOpenedByOwner
Dim ds As New TicketsOver60
' set the stored procedure parameter values
With da.SelectCommand

.CommandType = CommandType.StoredProcedure
'.Parameters.Add("@lngCurrentCreatorID", ddlCreatorList.SelectedValue)
'.Parameters.Add("@OrderID", cmbOrders.SelectedValue)

End With

' map the generic "Table" to the typed
' dataset table named "GetInvoiceForCustomer_sp
da.TableMappings.Add("Table", "uspTicketOver60Days")

' fill the dataset
da.Fill(ds)

' set the report document's data source to the dataset
rptTicketsOver601.SetDataSource(ds)

' create the stream object
Dim st As System.IO.Stream
st = rptTicketsOver601.ExportToStream( _
ExportFormatType.PortableDocFormat)

' set the http headers
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"

' read the stream as binary (a byte array) and
' write the byte array to the Response object
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)

Response.End()

Thank you so much for your help
Bensta
 
sorry I have never used the ReportDocument Control. I always use the viewer. very straight forward.

 
Thank you dvannoy for trying to help though.
I just have a stupid question to ask.
Now if I follow all the steps to deploy the asp.net app with the crystal reports correctly. And once I ran the deployment package files into the virtual directory I creat during the app set up: Should the application directory structure look the same as the same the one I have locally? Will all the reports be visible on the web server once deployed or they will be hidden? I guess I am not sure about the concept of strongly-untyped/Typed report? I do not see the cr reports under the ReportFilesFolder on the Web Server of the deployed app?

My current application root structure is as follow:

MyProjectFolder
MyProject1
MyProject2
HelpDocFileFolder where all the helpfiles are stores
ReportFileFolder where all the cr reports are stored
ImagesFilesFolder: // /// // images are stored
my aspx pages are located under the MyProject1 folder
 
well if you use the viewer there will be no reports created until the viewer creates them. the viewer is just that, a viewer. the way the viewer works is, you create an aspx page, drop a viewer on it and that page then becomes your report. the report doc control may work similar as well. I think the only time there is reports stored in a directory is when those are "existing" Crystal reports that were created by using a full version of crystal.

hope this helps.

i will try and find info on using the report doc control. post back if want help using the viewer with a dataset.

 
So basically they get compiled into the assembly or something if we don't create them using the full version of crystal report? Another thing I noticed is the actual cr report temporary files get created in the window temp directory, but still getting the error: footer or header page biger than page.
I would really appreciate help using the viewer with a dataset. Maybe that will take care of my problem
Thank you so much
Bensta
 
OK, start here...

scroll down to the Push Method..follow those directions to create your dataset etc..

I don't use there code so if you need help with that let me know. I just want you to see a visual of how and what steps are needed.
 
Could you share your code with me please? I would really appreciate it.
Also do you think the reason I am getting the Report Header or Footer Error i because the client machine requesting the report is missing some DLL's that converts the crystal report to pdf format on the spot or is the actual process done on the server? Or could it be the report header of the footer is larger than the page? I am using 1280 x 800 screen resolutions. If so, do you know how I could make the header/footer smaller?
Thank you so much for you help
Bensta
 
No, I don't think it has anything to do with the client..

take a look at this thread.. This has so code in it that will help you.. it's a long thread..

thread855-1202810


 
dvannoy thank you so much the code and your help. I appreciate it a lot.
Now using the CrystalReportViewer Control the cr report display on the screen in centered position. Do you know by chance how to make it display left aligned just like the default layout?
Maybe that's what is causing the error I ran into previousely?
Thank you. You deserve a big star!!!
Bensta
 
Thank you. You deserve a big star!!!
Maybe you should mark dvannoy's post as helpful then and then they will get their "big star".


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top