Rattlesnake Posted July 1, 2005 Posted July 1, 2005 Hi , I have an ASP.net (VS.net 2003) application for Purchase ORders. I am trying to create a Crystal Report for the Purchase Order so that the user can preview it and print it. The purchase Order can have a maximum of 10 items in it. My questions are: 1. How can I base this crystal report on a stored procedure from Sql Server 2000 2. The Purchase Order report will be a grid like report. The items will be listed in a grid. If the items are less than 10 , I want the report to show blank rows , so that the grid is the same size every time. How can I do this?? 3. Is there an easier way to print the Purchase ORder , other than using crystal report. I dont want to use the printing from the Web browser. Thanks Quote When you gotta go,you gotta go !!!!!!!
Puiu Posted July 3, 2005 Posted July 3, 2005 I can't help you with the 2nd and 3rd question but i can help you with the first one: After selecting the server and the database for the report file, instead of selecting a table from the database, double click "Command" (it should appear above the database's name). After that write in the textbox that just appeared the exact name of the stored procedure. You should have now the fields that the stored procedure returns Quote
mike55 Posted July 4, 2005 Posted July 4, 2005 In relation to question 2, Right click the field on the crystal report and select format, select the Common tab and check the Suppress checkbox. Click on the button opposite the suppress checkbox (on the right-hand side marked X+2). Select the field from the Report fields then type: "<10" (without the quotation marks). Then click the save and close button. If the formula is correct, then you won't get an error, if you do try messing around with the Function conversion. In relation to Q3 convert the report to .pdf format. dim orpt as new "ReportName" Try 'The following try catch statement is responsible for generating the report in a .pdf format. Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo crLogonInfo = oRpt.Database.Tables(0).LogOnInfo crLogonInfo.ConnectionInfo.ServerName = "(local)" crLogonInfo.ConnectionInfo.UserID = dsGlobal.readReg("Software", "SureTxt", "User") crLogonInfo.ConnectionInfo.Password = dsGlobal.readReg("Software", "SureTxt", "Pass") oRpt.Database.Tables(0).ApplyLogOnInfo(crLogonInfo) Dim myExportOptions As CrystalDecisions.Shared.ExportOptions Dim myDiskFilesDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions Dim myExportFile As String myExportFile = "C:\temp\PDF " & Session.SessionID.ToString & ".pdf" myDiskFilesDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions myDiskFilesDestinationOptions.DiskFileName = myExportFile myExportOptions = oRpt.ExportOptions With myExportOptions .DestinationOptions = myDiskFilesDestinationOptions .ExportDestinationType = .ExportDestinationType.DiskFile .ExportFormatType = .ExportFormatType.PortableDocFormat End With oRpt.Export() Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/pdf" Response.WriteFile(myExportFile) Response.Flush() Response.Close() System.IO.File.Delete(myExportFile) Catch End Try Hope this helps. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.