How to enhance the Excel export from Crystal Reports
Hello,
I am new in Crystal Reports and I wonder if it is possible to enhance the Excel export from Crystal Reports with post-processing that would be applied to the Excel exported file.
By example, is it possible to freeze the window panes, so rows and columns are frozen in place on the screen?
Is there any possibility to obtain the file exported to excel to work with.
Or maybe there is some ways to parametrize the Excel export from Crystal Reports?
Any suggestions are welcomed.
If you are using Crystal Reports 2008 you can use the Report Application SDK that is now available.
It has a object called PrintOutputController that has an export method that allows you to get access to the exported file before you send it to the user.
Check the Developer library and the samples for details.
<a href="/blog/10">Rob's blog - http://diamond.businessobjects.com/robhorne</a>
Similar Messages
-
How to view the History of a Crystal Reports iView in EP6?
How to view the History of a Crystal Reports iView in EP6?
Our Crystal reports are viewed via Crystal Enterprise and are both BW and non-BW Crystal reports.
I have looked at the three supplied iViews from Business Objects (alert, folder and thumbnail) but I have only been able to access the last instance or run on demand a CR.
Our users would prefer to see a listing of the past runs of the report and choose which report to view. What parameters need set in the EP6 iView to see the history of a report?Hi Heather,
it is correct that there is no sample iView that shows the History of Crystal Reports that are stored in Crystal Enterprise but there a sample codes on our web site and there are sample codes as part of the SDK documentation that show how to call the history and you should be able to take the code and create your own Java or ASP iView based on that.
the link to our developer library :
http://www.businessobjects.com/products/dev_zone/default.asp?intcmp=products12
hope this helps
Ingo -
How to disconnect the database connection using crystal report
Post Author: cp_pramodu
CA Forum: Crystal Reports
Hi All,
We have developed an application using .Net and Crystal Reports 10 for generating Adhoc reports from Business system (db sybase 12). We are using the below mentioned script for opening rpt files.
Try
ReportDocument1.Load(sReportName)
For Each table In ReportDocument1.Database.Tables
' Get the TableLogOnInfo object.
logonInfo = table.LogOnInfo
' Set the server or ODBC data source name, database name,
' user ID, and password.
logonInfo.ConnectionInfo.ServerName = sReportServerName
logonInfo.ConnectionInfo.DatabaseName = DBName
logonInfo.ConnectionInfo.UserID = UserName
logonInfo.ConnectionInfo.Password = Password
' Apply the connection information to the table.
table.ApplyLogOnInfo(logonInfo)
Next
'Me.Cursor = Cursors.WaitCursor
Me.CrystalReportViewer1.ReportSource = ReportDocument1
'Me.Cursor = Cursors.Default
Catch ex As Exception
'Response.Write(ex.Message)
Finally
Me.Cursor = Cursors.Default
'ReportDocument1.Close()
'ReportDocument1.Dispose()
End Try
Each time user opens the report a new connection is established to the database, can we disconnect the connection established from crystal reports, while closing crystal report. At the same time i want to setup an Idle time for these connections. In database level, i will not be able to set idle time in database level, as it affect our electronic channels.
Waiting for a reply.
Thanks & Regards,
Pramodu. C. PHi,
If you are reworking the application can you not build in the functionality to re-establish a connection if there is a failure? That is, a submission from the application server to the database server detects a failure, etc. and then re-establishes the connection. If you need a more frequent check than during a user-initiated roundtrip, you may be best served by using the "dummy query" technique on some time interval.
From my understanding using HA Event Notification would require a RAC database (plus a multi-threaded application and services correctly configured on the RAC-side).
In the documentation I see this:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci09adv.htm#sthref1495
"Applications must connect to a RAC instance to enable HA event notification."
In any case, this has the potential to be a bit complicated...
Regards,
Mark -
How to print directly to Printer from Crystal Report Viewer ?
Hi All,
We are integrating our Java Web Application with Crystal report XI, currently using JRC and export to PDF for user to preview and print to local printer.
Now there is new requirement :
Some clients is using thin client terminal (no harddisk, only has OS +Browser in ROM), so I cannot install Acrobat Reader for them to preview&print the report.
So I am looking at Crystal Report Viewer, the question is : Can I print from Crystal Report Viewer directly to local printer without first converting it to PDF (because I can't have acrobat reader installed) ??
Thank you very much,
Krist
IndonesiaHi,
It can't be achieved through XI.
JRCXI R2 SDK offers the ability to print the report server side
using the PrintOutputController using printReport(PrintReportOptions printReportOptions) method.
Here is the code(for XIR2):
import="com.crystaldecisions.reports.sdk.*"
import="com.crystaldecisions.sdk.occa.report.lib.*"
import="com.crystaldecisions.sdk.occa.report.document.*"
try {
final String REPORT_NAME = "Inventory.rpt";
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(REPORT_NAME, 0);
//Create and set print options.
PrintReportOptions printOptions = new PrintReportOptions();
//Note: Printer with the 'printer name' below must already be configured.
printOptions.setPrinterName("
10.10.45.220
BOBJ 2C");
printOptions.setJobTitle("Sample Print Job from JRC.");
printOptions.setPrinterDuplex(PrinterDuplex.horizontal);
printOptions.setPaperSource(PaperSource.auto);
printOptions.setPaperSize(PaperSize.paperLetter);
printOptions.setNumberOfCopies(1);
printOptions.setCollated(false);
PrintReportOptions.PageRange printPageRange = new PrintReportOptions.PageRange(1,1);
printOptions.addPrinterPageRange(printPageRange);
//NOTE: If parameters or database login credentials are required, they need to be set before.
//calling the printReport() method of the PrintOutputController.
reportClientDoc.getPrintOutputController().printReport(printOptions);
reportClientDoc.close();
out.println("Successfully sent report to the printer.");
catch(ReportSDKException ex) {
out.println(ex);
Please revert in case you have any query.
Thanks,
Neeraj -
No Hyperlink in PDF after export from Crystal Reports 2008 SP2
When I export a report from Crystal Reports 2008 Developer (as well as from the runtime) SP2 to PDF the Hyperlink to a file on hard disk is missing.
Hi,
Go through this LInk
Re: No hyperlinks after exporting to pdf
Regards,
Salah -
How to freeze the columns in excel exported from SSRS report??
We have created a report for our client. The client wants the report in excel format. As there are nearly about 30,000 rows in the excel. Client wants us to freeze the column header names in the excel so that even after scrolling down they
will be able to see the column names.
can anybody have idea how to achieve this in SSRS?Hi Shard,
Thanks for your post, You can achive your requiremets by using the below logic. hope this will help you.
Steps to achieve it
1. Select the tabix and click on Tablix properties.
2. In the General tab under Column Headers section you can see "Keep header visible while scrolling" checkbox, check it.
3. Now the header row will be remain fixed in the report.
OR
1. In the grouping pane, make sure to turn on advanced mode (click on the small black down arrow on the far right of the grouping pane)
2. Select the corresponding (Static) item in the row group hierarchy
3. In the properties grid, set RepeatOnNewPage to true
4. KeepwithGroup to After
OR
1)Freeze the header of all columns[ Freezing table header ] : To do select static member of table header row from row groups [ Advanced Mode ] and set FixedData to true
2) Freeze the initial 2 columns : To do select static member of columns in column group and set fixedData to true .
How do you freeze the tablix header row in an Excel export file in SSRS 2008
Suhas Kudekar
Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.
My Blog
Follow @SuhasKudekar -
How to get the EXCEL file from web site (b2b) into SAP system?
Hi Guys,
I have a requirement of saving the excel file that has been send to SAP system from a B2B site.
Currently there is a call to the SAP system from the B2B site via an RFC function ,this RFC functions gets the excel file as an input to the SAP system,i need to store this Excel file in the SAP (as an excel file itself).
How can i acheive this?
Please suggest.
Thanks ,
SwatiYou can extract a date portion and assign to the variable and then compare with GETDATE()
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to Print the Excel Sheet From Labview??
Hii Every body,,
Actually i am logging my data to Excel Template..... Now in my front panel i will select that excel file and give print... Now automatically the datas in the excel sheet have to get printed with out opening the excel sheel... how to do?? can any 1 suggest me??I think you can get many/most of your answers here in the Excel Board thread in Breakpoint forum.
- Partha
LabVIEW - Wires that catch bugs! -
Cannot export crystal report in excel format from crystal report viewer
This problem occurs on only one workstation.
Open Advanced Reports > Enter workorder # > Click on 'workorder work(uninvoiced)' > Work order opens.
Click on icon "Export report"
Save as type: change to .xls
Error: Crystal Report Windows Forms Viewer. Error in file
SAP.......rpt:
Error detected by export DLL:
Export failed.Try adding c:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to your windows enviroment variable PATH then restart.
-
I am processing a crystal report on RAS server,and exporting it to PDF, using the RAS Dlls.
Dim Report As ReportClientDocument
Dim crExportData As New ByteArray
Dim crExportType As CrReportExportFormatEnum
crExportType = CrReportExportFormatEnum.crReportExportFormatPDF
crExportData = Report.PrintOutputController.Export(crExportType)
A gray background is applied to an object in crystal report, with RGB color code (216,216,216).
On exporting this report to pdf, the color appears as required.
However, when printing this PDF in a digital printer (uses CMYK color format), the color changes to Pinkish Gray.
The color remains gray as required, in other printers.
Is there any way to make the exported PDF CMYK compliant?
Please help.From the info, I have no idea what version of .NET and CR you are using...
How is the printing from the CR designer?
How is the printing to another printer, say HP?
Do you have the latest updates for Digital Printer (CMYK) installed?
How does a plain pic with grey background print from a .NET app? (E.g.; is this a CR issue, or a framework issue? See:
RGB to CMYK (Plugin) - Plugins - Publishing ONLY! - Paint.NET Forum
RGB VS. CMYK: WHEN TO USE WHICH AND WHY - Crux Creative
http://www.sumydesigns.com/2012/12/06/color-rgb-vs-cmyk-web-color-vs-print-color/
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
"Catastrophic Failure" trying to export from Crystal Reports Explorer v10.5
In using Crystal Reports Explorer v10.5 (add on to Crystal Enterprise v10) I am trying to export just over 211k records to MS Word.
The data is coming from a Business View (created in Business View Manager) that uses an OLEDB connection to an Oracle database.
I get the following error message:
CrystalReportVIewer
Error caught in ICrystalReportGridViewerImpl::render
webReporting.dll '0x80004005'
Catastrophic failure
line: 16031
I have no idea what's causing this or how to resolve it. Can anyone assist? Thank you!!
Edited by: AmberDoreen on Mar 21, 2009 2:03 AMNo - it doesn't work with any of the viewers and the same error occurs. I think we've determined that it's due to the amount of data and the % of resource allocation in order to export the results. The query behind the data is pretty complex, and the Oracle views that are being accessed are also pretty beefy. It's just a huge hit on resources. I've advised my client to provide more filters & reduce the amount of returned rows to see if that clears things up. I'm waiting to hear if they are successful. Thanks for responding, though! I'll update once I hear from the client.
-
Excel export in crystal report
Post Author: aravinthkula
CA Forum: Crystal Reports
I have a requirement to open a new window from one of the reportviewer report columns, I know we have to use Navigation->Hyperlink Action->Jump To Url->="BLOCKED SCRIPTvoid(window.open('http://samplewebsite.com', '_blank'));"
And then I try to export to excel, From excel I am trying to open the link, I am getting the message "This location may be unsafe" or "hyperlinks can be harmful to your computer and data. To protect your computer, click only those hyperlinks from trusted sources."
Is there another way to open a link in new window which is compatible from Reportviewer and from Excel as well.Try adding c:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to your windows enviroment variable PATH then restart.
-
Export from Crystal Reports 2008 viewer fails if run on separate thread
I have a windows desktop application written in Visual Basic using Visual Studio 2008. I have installed and am trying Crystal Reports 2008 to run a report. Everything seems to work well except that when I preview a report (using the viewer control) and click the export button found in the upper left corner of that control, I get the following message:
Error 5: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
I am a little confused on what to do exactly. Is the problem because I am running in the Visual Studio 2008 IDE? It says this exception is only raise if a debugger is attached to the process. No, I tried running it outside the IDE. The exception wasn't generated but the application hung when the button was clicked.
It says the current thread must be set to single thread apartment (STA) mode. If the report is run on its own thread, is the "current" thread the thread the report is running on or is the main application's UI thread? I don't think I want to set my main application to single thread apartment mode because it is a multi-threaded application (although I really don't know for sure because I am new to multi-threaded programming).
My objective is to allow reports to run asynchronously so that the user can do other things while it is being generated. Here is the code I use to do this:
' Previews the report using a new thread (asynchronously)
Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
Dim backgroundProcess As System.ComponentModel.BackgroundWorker
' Start a new thread to run this report.
backgroundProcess = New System.ComponentModel.BackgroundWorker
Using (backgroundProcess)
' Wire the function we want to run to the 'do work' event.
AddHandler backgroundProcess.DoWork, AddressOf PreviewReportAsynch_Start
' Kick off the report asynchronously and return control to the calling process
backgroundProcess.RunWorkerAsync(sourceDatabase)
End Using
End Sub
Private Sub PreviewReportAsynch_Start(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
' The source database needed to call preview report was passed as the only argument
Call PreviewReport(CType(e.Argument, clsMainApplicationDatabase))
End Sub
' Previews the report. From the preview window, the user can print it.
Public Function PreviewReport(ByVal sourceDatabase As clsMainApplicationDatabase) As FunctionEndedResult
Dim errorBoxTitle As String
Dim frmPreview As frmReportPreview
' Setup error handling
errorBoxTitle = "Preview " & Name & " Report"
PreviewReport = FunctionEndedResult.FAILURE
On Error GoTo PreviewError
' Set up the crxReport object
If InitializeReportProcess(sourceDatabase) <> FunctionEndedResult.SUCCESS Then
GoTo PreviewExit
End If
' Use the preview form to preview the report
frmPreview = New frmReportPreview
frmPreview.Report = crxReport
frmPreview.ShowDialog()
' Save any settings that should persist from one run to the next
Call SavePersistentSettings()
' If we got this far everything is OK.
PreviewReport = FunctionEndedResult.SUCCESS
PreviewExit:
' Do any cleanup work
Call CleanupReportProcess(sourceDatabase)
Exit Function
PreviewError:
' Report error then exit gracefully
ErrorBox(errorBoxTitle)
Resume PreviewExit
End Function
The variable crxReport is of type ReportDocument and the windows form called 'frmPreview' has only 1 control, the crystal reports viewer.
The print button on the viewer works fine. Just the export button is failing. Any ideas?Hi Trevor.
Thank you for the reply. The report document is create on the main UI thread of my application. The preview form is created and destroyed on the separate thread. For reasons I won't get into, restructuring the code to move all the initialization stuff inside the preview form is not an option (OK, if you a really curious, I don't always preview a report, sometimes I print and/or export it directly which means the preview form isn't used).
What I learned through some other research is that there are some things (like COM calls and evidently some OLE automation stuff) that cannot be run on a thread that uses the MTA threading model. The export button probably uses some of this technology, thus the message stating that an STA threading model is required. I restructured the code as follows to accomodate this requirement. Here is a sample:
' Previews the report using a new thread (asynchronously)
Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
Dim staThread As System.Threading.Thread
' Start the preview report function on a new thread
staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep1)
staThread.SetApartmentState(System.Threading.ApartmentState.MTA)
staThread.Start(sourceDatabase)
End Sub
Private Sub PreviewReportAsynchStep1(ByVal sourceDatabase As Object)
Dim staThread As System.Threading.Thread
' Initialize report preview. This includes staging any data and configuring the
' crystal report document object for use by the crystal report viewer control.
If InitializeReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase)) = FunctionEndedResult.SUCCESS Then
' Show the report to the user. This must be done on an STA thread so we will
' start another of that type. See description of PreviewReportAsynchStep2()
staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep2)
staThread.SetApartmentState(System.Threading.ApartmentState.STA)
staThread.Start(mcrxReport)
' Wait for step 2 to finish. This blocks the current thread, but this thread
' isn't the main UI thread and this thread has no UI anymore (the progress
' form was closed) so it won't matter that is it blocked.
staThread.Join()
' Save any settings that should persist from one successful run to the next
Call SavePersistentSettings()
End If
' Release the crystal report
Call CleanupReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase))
End Sub
' The preview form must be launched on a thread that use the single-threaded apartment (STA) model.
' Threads use the multi-threaded apartment (MTA) model by default. This is necessary to make the
' export and print buttons on the preview form work. They do not work when running on a
' thread using MTA.
Public Sub PreviewReportAsynchStep2(ByVal crxInitializedReport As Object)
Dim frmPreview As frmReportPreview
' Use the preview form to preview the report. The preview form contains the crystal reports viewer control.
frmPreview = New frmReportPreview
frmPreview.Report = DirectCast(crxInitializedReport, ReportDocument)
frmPreview.ShowDialog()
End Sub
Thanks for your help!
Andy -
Reg : How to get the company address in Crystal Report
Dear members,
I am stuck up with problem in Crystal Report in my project. I want to get the company address in the Crystal Report. How can i get the company address in the crystal report. Hope i will get help in this regard.
Thank you.
Regards,
Venkatesh RajagopalanHi Dear
plz send me what is your methad to applay,
so i am sending u code for company address
all company information contain the OADM table ,
so applay the select query ang get the data form table
this ia sample code ........
SAPbobsCOM.Recordset oRecordset = (SAPbobsCOM.Recordset)ICreon_SBOAddOn.SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
string GetComp = "select * from OADM ";
oRecordset.DoQuery(GetComp);
strCompName = oRecordset.Fields.Item("CompnyName").Value.ToString().Trim();
Use this code u will find the company name
and after that pass this valu a parameter
oRPT.SetParametervalue ("CompanyName", strCompanyName)
so pass the strCompanyName as a parameter in the cdrystel report.
hope help this code ,
if u have any problem so plz send me question in form,
if u r satisfied my answer so pl give me rewards point, -
How to connect to a Unix from Crystal Reports running on windows?
<p>Any idea on how to connect from windows Crystal Reports X1 client to a Unix box
file directoriesu2026<br>
<br>
Any suggestions would be much appreciatedu2026<br>
</p>
Edited by: DarkNight on Nov 13, 2009 10:42 AMHi Darknight,
What is it you want to find once you are connected? Since you posted this in the Database Connectivity forum I assume you want to connect to some DB or flat file on that server? If it's a DB then use the client to connect from windows. If it's a flat file then you should be able to use whatever connection utility you use to see the file system from windows. I don't know Unix so not sure but need more details.
Thank you
Don
Maybe you are looking for
-
Hi All, I have to do archiving using PBS . standard program for arching is RM06EL00 but using PBS the sap has converted this program into /PBS/RM06EL00. There is one bug in this program as follows:- when i running this program with multiple vendors f
-
BADI for MM01,02 and 03 when Materials are
Hi Experts, I have a requirement of tracking any changes in the material master data i.e. whenever a material is changed, deleted or created i want to update a custom Z table . I am very new to Material Management. I believe that these 3 operations v
-
Error in dependencyCheck java.util.zip.ZipException: invalid entry CRC
Hi, While running java/j2ee project in Linux, i got error like dependencyCheck, what is the problem for this error, how to slove??? If i run this project in windows operating system its working fine.. The error is like... dependencyCheck java.util.zi
-
Firefox install causes error messages during startup and freezes during running
I installed firefox 20 on Windows 7 and when I reboot I see several messages telling me that I am missing dll files. I have verified that all the dll files are in the install folder. I was able to run firefox without running firebug and just putting
-
Hi , How to make a calculated kf as local in the query definition
Hi , How to make a calculated kf as local in the query definition Regards, Ravi.