Ok.let me be precise.i hav few crystal reports in windows application.also print button in which i provide option to print report in DOS mode. (using bat file - print printername Report.PRN). To meet the above purpose i created a paginated text file (PRN) from crystal report.since there is no direct method avlbl in Crystal report 9.i exported the report to excel format and then conveted excel file into PRN file using COM Excel library. The application works fine.but the client machine requires MS Excel to be installed.i wud like to know alternative solution for the above.i hope u r clear about my requirementRegardsRaju. Hi.im happy to share it with u.i don hav exact code in my hand now.since im on leave and in my hometown.add refernce of COM Excel library. And create an object of Excel.Application and create workbook object. Then open the excel document(which u hav exported using crystal report 9).
![]() ![]()
My VS 2005 standard edition does not come out with crystal report, may i know where can i download crystal report and install for VS 2005? Hi lucerias, Glad to see your reply. Sorry for misunderstanding your concern. As far as I know there's no way to add reports directly into the Standard edition. It may be worth looking at upgrading to the. How to get sum of groups in crystal report 10? Ask Question Asked 8 years, 11 months ago. Active 3 years, 11 months ago. Viewed 42k times 6. I have a report with for some invoices and each invoice has some lines like this: invoice1 2000 line1 300 line2 700 line3.
Then use the Saveas(filename,filetype) function. Use formatted text as file type.this is the way how its done.the real code i can send u after i join in my office.(see the sample code belowDim objExcelDim objWorkBookSet objExcel = CreateObject('EXCEL.APPLICATION')Set objWorkBook = objExcel.Workbooks.Open('C:testtest.xls')objExcel.ActiveWorkbook.SaveAs(SavePath + @'NonTemplateReport',Excel.XlFileFormat.xlWorkbookNormal, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing, Type.Missing, Type.Missing, Type.Missing);objWorkBook.Close TrueSet objWorkBook = NothingSet objExcel = Nothing)Regards. Hi.see the code belowRegardsPublic Function CreateExcelFile As BooleanDim objExcel As Excel.ApplicationDim objWorkbook As Excel.WorkbookDim objSheet As Excel.WorksheetDim objRange As Excel.RangeDim strTmpfile As String' Start Excel and get Application objectobjExcel = New Excel.ApplicationobjExcel.Visible = FalsestrTmpfile = Fileinput.Substring(0, Fileinput.IndexOf('.' , 0))ExcelOutputFile = strTmpfile & '.PRN'Dim objExcFile As New FileInfo(FilePath & ' & ExcelOutputFile)If objExcFile.Exists = True ThenobjExcFile.DeleteEnd IfobjExcFile = NothingTry' Open a workbook for the input FileobjWorkbook = objExcel.Workbooks.Open(FilePath & ' & Fileinput)objSheet = objWorkbook.ActiveSheetobjSheet.SaveAs(FilePath & ' & ExcelOutputFile, Excel.XlFileFormat.xlTextPrinter)Catch ex As ExceptionMsgBox(ex.Message)FinallyobjSheet = NothingobjWorkbook.Close( False, False )objWorkbook = NothingobjExcel.QuitobjExcel = NothingEnd TryEnd Function.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |