Crystal Reporter sets Orientation
Hi Experts,
My client has an issue is with a Crystal Report. The issue is this:
Client wants to print labels using an A4 sheet of Labels. He has created the report layout. Let us say that the report box is 7cm wide x 4 cm tall.
When setting the report size, Crystal automatically sets the page orientation to landscape, purely because the report box is wider than it is tall. This is not wanted!
The labels need to be printed on portrait orientated paper. The label size is easily narrow enough to print on portrait orientated paper but Crystal automatically decides that the orientation should be landscape.
Is there any way around this? We have found that amending the printer properties (setting it to portrait) is a workaround but this would need to be done for every print which is time consuming.
Greig
Hi Greig,
You may find more thread to complain the same problem. CR is too smart in this orientation matter. It won't allow portrait if the width is more than height. The workaround is: add a non visible text box to make the frame like normal, i.e. Height > Width.
Thanks,
Gordon
Similar Messages
-
Crystal Report - Set Parameter Value - Case sensitive
Hi,<br><br>
We are using Crystal report 2008 CR4E API to implement the crystal report in our application. When we use parameter report with different cases, the code is not setting values for all the parameter fields in the report. Kindly help us in achieving the solution.
<br><br>
In Report, SQL Command is used and a parameter is passed to the SQL. The name of the parameter is given uppercase but in the SQL Command it is given in lowercase. The report still pass the parameter to the query and it is running fine in designer.
But in our application it throws the below exception. If the parameters are defined in same case then it works fine.
<br><br>
Code:<br><br>
reportClientDocument = new ReportClientDocument();<br>
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);<br>
reportClientDocument.open(reportName, OpenReportOptions._openAsReadOnly);<br>
DatabaseController dbController = reportClientDocument.getDatabaseController();<br>
Tables tables = dbController.getDatabase().getTables();<br>
ITable table = tables.getTable(0);<br>
IProcedure command = (IProcedure)table;<br>
ParameterFieldController paramController = reportClientDocument.getDataDefController().getParameterFieldController();<br>
for (int i=0; i< command.getParameters().size(); i++) {<br>
ParameterField commandParam = (ParameterField) command.getParameters().get(i); <br>
String paramName = commandParam.getName();<br>
String paramValue = getParmeterValues(paramName);<br>
paramController.setCurrentValue("", paramName, Integer.valueOf(paramValue)); <br>
}<br>
<br><br>
Exception:<br>
<br>Assertion Failed:
<br>java.lang.Throwable
<br> at com.crystaldecisions.reports.common.asserts.CrystalAssert.ASSERT(Unknown Source)
<br> at com.crystaldecisions.reports.common.asserts.CrystalAssert.ASSERT(Unknown Source)
<br> at com.crystaldecisions.reports.queryengine.Connection.a(SourceFile:2558)
<br> at com.crystaldecisions.reports.queryengine.Connection.a(SourceFile:645)
<br> at com.crystaldecisions.reports.queryengine.Table.a(SourceFile:2234)
<br> at com.crystaldecisions.reports.queryengine.Table.if(SourceFile:2161)
<br> at com.crystaldecisions.reports.queryengine.Table.for(SourceFile:709)
<br> at com.crystaldecisions.reports.queryengine.b.yk(SourceFile:512)
<br> at com.crystaldecisions.reports.queryengine.b.yl(SourceFile:878)
<br> at com.crystaldecisions.reports.queryengine.QueryInfo.vE(SourceFile:241)
<br> at com.crystaldecisions.reports.datafoundation.DFQuery.for(SourceFile:628)
<br> at com.crystaldecisions.reports.datalayer.a.do(SourceFile:1621)
<br> at com.crystaldecisions.reports.datalayer.a.a(SourceFile:1404)
<br> at com.crystaldecisions.reports.dataengine.m.b(SourceFile:334)
<br> at com.crystaldecisions.reports.dataengine.j.b(SourceFile:515)
<br> at com.crystaldecisions.reports.dataengine.m.o(SourceFile:408)
<br> at com.crystaldecisions.reports.dataengine.m.a(SourceFile:173)
<br> at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:114)
<br> at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:95)
<br> at com.crystaldecisions.reports.dataengine.j.case(SourceFile:1080)
<br> at com.crystaldecisions.reports.dataengine.h.<init>(SourceFile:108)
<br> at com.crystaldecisions.reports.dataengine.DataContext.a(SourceFile:254)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4660)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4574)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.new(SourceFile:2652)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.byte(SourceFile:2610)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.try(SourceFile:2282)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.int(SourceFile:2442)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.I(SourceFile:1013)
<br> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.fo(SourceFile:526)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.if(SourceFile:613)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.a(SourceFile:578)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.X(SourceFile:387)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.moveToPageN(SourceFile:339)
<br> at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:78)
<br> at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:247)
<br> at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:642)
<br> at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)
<br> at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)
<br> at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1944)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)
<br> at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)
<br> at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
<br> at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
<br> at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
<br> at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
<br> at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
<br> at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)
<br> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)
<br> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)
<br> at com.crystaldecisions.sdk.occa.report.application.ReportSource.export(SourceFile:286)
<br> at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.export(SourceFile:209)
<br> at com.mysystems.myapp.common.CrystelReport.print(CrystelReport.java:387)
<br> at com.ibm._jsp._ShowReport._jspService(_ShowReport.java:316)
<br> at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
<br> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
<br> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1087)
<br> at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
<br> at com.mysystems.myapp.common.MyServletFilter.doFilter(MyServletFilter.java:107)
<br> at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
<br> at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
<br> at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
<br> at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
<br> at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:680)
<br> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:588)
<br> at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
<br> at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
<br> at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:232)
<br> at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
<br> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
<br> at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
<br> at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
<br> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
<br> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
<br> at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
<br> at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
<br> at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
<br> at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
<br> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
<br> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
<br> at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
<br> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
<br> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
<br>Rowset restart: moveToStart true
<br>Rowset execute
<br>Executing query using command text:
<br>Select DeptName from Dept where DeptNo = {?deptno}
<br>
<br>detected an exception: Unexpected database connector error
<br>...
<br>Caused by: com.crystaldecisions.reports.common.QueryEngineException: Unexpected database connector error
<br> at com.crystaldecisions.reports.queryengine.Connection.bf(SourceFile:2958)
<br> at com.crystaldecisions.reports.queryengine.Rowset.z3(SourceFile:944)
<br> at com.crystaldecisions.reports.queryengine.Rowset.bL(SourceFile:533)
<br> at com.crystaldecisions.reports.queryengine.Rowset.zM(SourceFile:245)
<br> at com.crystaldecisions.reports.queryengine.Connection.a(SourceFile:776)
<br> at com.crystaldecisions.reports.queryengine.Table.a(SourceFile:2234)
<br> at com.crystaldecisions.reports.queryengine.Table.if(SourceFile:2161)
<br> at com.crystaldecisions.reports.queryengine.Table.for(SourceFile:709)
<br> at com.crystaldecisions.reports.queryengine.b.yk(SourceFile:512)
<br> at com.crystaldecisions.reports.queryengine.b.yl(SourceFile:878)
<br> at com.crystaldecisions.reports.queryengine.QueryInfo.vE(SourceFile:241)
<br> at com.crystaldecisions.reports.datafoundation.DFQuery.for(SourceFile:628)
<br> at com.crystaldecisions.reports.datalayer.a.do(SourceFile:1621)
<br> at com.crystaldecisions.reports.datalayer.a.a(SourceFile:1404)
<br> at com.crystaldecisions.reports.dataengine.m.b(SourceFile:334)
<br> at com.crystaldecisions.reports.dataengine.j.b(SourceFile:515)
<br> at com.crystaldecisions.reports.dataengine.m.o(SourceFile:408)
<br> at com.crystaldecisions.reports.dataengine.m.a(SourceFile:173)
<br> at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:114)
<br> at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:95)
<br> at com.crystaldecisions.reports.dataengine.j.case(SourceFile:1080)
<br> at com.crystaldecisions.reports.dataengine.h.<init>(SourceFile:108)
<br> at com.crystaldecisions.reports.dataengine.DataContext.a(SourceFile:254)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4660)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4574)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.new(SourceFile:2652)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.byte(SourceFile:2610)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.try(SourceFile:2282)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.int(SourceFile:2442)
<br> at com.crystaldecisions.reports.dataengine.DataProcessor2.I(SourceFile:1013)
<br> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.fo(SourceFile:526)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.if(SourceFile:613)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.a(SourceFile:578)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.X(SourceFile:387)
<br> at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.moveToPageN(SourceFile:339)
<br> at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:78)
<br> at com.crystaldecisions.reports.formatter.export2.a.a(SourceFile:247)
<br> at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.if(SourceFile:642)
<br> at com.crystaldecisions.reports.formatter.export2.ExportSupervisorEx.a(SourceFile:586)
<br> at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:636)
<br> at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1944)
<br> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
<br> ... 49 more
<br>Caused by: com.businessobjects.reports.jdbinterface.common.DBException: Unexpected database connector error
<br> at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCQueryDefinition.Execute(Unknown Source)
<br> at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCQueryDefinition.Execute(Unknown Source)
<br> at com.crystaldecisions.reports.queryengine.Connection.bf(SourceFile:2953)
<br> ... 91 more
<br>Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '?'.
<br> at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
<br> at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
<br> at com.mysystems.myapp.connection.StatementImplementaion.execute(StatementImplementaion.java:269)
<br> ... 94 moreHi,
Can some one please help with the solution -
Remove Html tags from export Crystal report Setting i
Hi,
I ma using CR 2008, BOXI 3.1 , Oracle
i)When ever i try to export i export it into CSV format and i am getting HTML tags , how do we remove them
ii) My second question is; I have a crystal report that is given by my friend and when ever i open it i ma getting a error saying UFL u2lgmt.dll missing .
i am using a java version ; How to overcome this?hi Venkatesh,
regarding the first question...you need to replace these tags manually in a formula and have that formula on the report instead of the db field.
e.g.
stringvar s:= {your field};
s:= replace(s, '<div>', '');
s:= replace(s, '</div>', '');
you'll have to do this for any potential tag in the field unfortunately.
please post question 2 as a new discussion as per the forum rules.
cheers,
jamie -
VS2010 Crystal Report Crashes System when using 'Set DataSource Location..'
Runtime ASP.NET 3.5
VS 2010
Under Database Fields (rt click) try Set DataSource Location... causes VS2010 to crash.
This is on an imported report from VS2008. VS2008 has no problem with the report.
Since this is a ASP.NET 3.5 program the internal property field
<ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>
has been set in the project in order to allow the code to compile w/out errors.
What is solution for Crystal Report Set DataSource Location?Hi Ken,
Here's one link on the issue: CRVS2010 RTM: Database Expert / External Component has thrown an exception
The reason is Old OS's used c:\temp as the default, now you are require to use %user%\temp as your temp folder as well as using the AppData folder for your app. If CR finds c:\temp it uses it and depending on what is in there it can cause Cr to crash, XML files have been know to do this.
Following MS's new rules on users temp folder should make your app Windows Compliant.
Thanks again
Don -
Change GUI Language in Crystal Reports XI
How can I change the GUI language of a installed Crystal Reports XI? At the installation, I have choosen "English" but now the GUI is in German.
As I found out, the GUI language depends on the regional settings in Windows. I have "Switzerland" as the default settings, so it seems the Crystal Reports sets the language to German. Is there a registry key or something else to change the language manually?
KR
StephanHi Stephan,
When you install CR XI it should have the option to select all languages, I don't recall exact steps now, I don't have it installed any more.
Try doing a Repair install in add/remove programs and select Custom to choose all the languages. It should then select your default local.
CR 2008 now gives you the option in the Designer itself to set this option.
You can also upgrade to CR XI R2 for free, use your XI Keycode to install it and be sure to select the languages you want to support.
https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
https://smpdl.sap-ag.de/~sapidp/012002523100013876392008E/crxir2win_sp5.exe
https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
Thank you
Don -
Regarding Crystal Report Setup Installation
Hi All,
I am unable to instal crystal report designer. The crystal report add on has been successful installed in SAP B1 and it is also featuring in the main menu. But the "Account set up" option is not working. None of the option of the crystal reporter is working and an error message is shown while the add on is started.
The Crystal Designer outside SAP is also not getting installed. Error message is showing- "Error Applying transforms"
Edited by: Rui Pereira on Jan 26, 2009 5:45 PMyes I have. But the I m then not able to do the Account set up. The crystal Reports options are visible in the main menu but not responding.
Can you suggest where can I get the crystal report set up files. May be the files I have used to install may get corrupt as they are very old and were the old evaluation version files.
Is it true that now crystal report package is free and full version released for integration with sap. -
Crystal report viewer does not observe the PaperSize and PageOrientation setting
Hi:
My application is a 3 tier application, where the WinForm client is connected to the WCF Services hosted in IIS server.
The report is generated on server side using WCF service, and export as.rpt with data, the .rpt file is then sent to the WinForm client, the Crystal Report viewer is used to load the .rpt file for preview and print.
On server side I've Microsoft XPS Document Writer installed and set as default printer. On the client side if the default printer is XPS or Nitro PDF creator, the report can be view and print correctly, report design in landscape will be able to show in the landscape in CR viewer, report design using custom paper size (e.g. Half Letter), CR viewer able to show it in Half Letter.
The problem that I'm facing is when the default printer is set to HP LaserJet P1120 or others (I've tried Epson ESC/P Standard driver), the report is always shown in the portrait, and it will not be able to show in custom paper size either. Here is my code:
Dim settings As New System.Drawing.Printing.PrinterSettings
Dim rep as New ReportDocument
rep.Load(sOutputFileName) 'The report is download from server and save in sOutputFileName
SetReportPaperSize(rep, sPaperSizeName, False, settings) ' sPaperSizeName store the name of the custom paper used in the report
CrViewer.ReportSource = rep
Public Shared Sub SetReportPaperSize(rep As ReportDocument, paperSizeName As String, isHardCopy As Boolean, settings As Printing.PrinterSettings)
Dim installedPrinters As Printing.PrinterSettings.StringCollection = Printing.PrinterSettings.InstalledPrinters
Dim printers As New List(Of String)
Dim sPrinter As String
If installedPrinters.Count = 0 Then
Return
End If
SetPrinterDefaultPaperSize(rep.PrintOptions, paperSizeName, settings)
With rep.PrintOptions
.PrinterName = settings.PrinterName
.PaperSource = PaperSource.Auto
If paperSizeName.Trim.Length > 0 Then
.PaperSize = DirectCast(GetPapersizeId(paperSizeName, settings, rep.PrintOptions.PaperSize), CrystalDecisions.Shared.PaperSize)
End If
End With
End Sub
Public Shared Sub SetPrinterDefaultPaperSize(printOptions As PrintOptions, paperSizeName As String, settings As Printing.PrinterSettings)
With settings.DefaultPageSettings
If paperSizeName.Trim.Length = 0 Then
. PaperSize = GetPaperSize (printOptions.PaperSize, settings)
Else
For Each size As Printing.PaperSize In settings.PaperSizes
If size.PaperName.EqualsTo(paperSizeName) Then
.PaperSize = size
Exit For
End If
Next
End If
.Landscape = printOptions.PaperOrientation = PaperOrientation.Landscape
.Margins.Top = printOptions.PageMargins.topMargin
.Margins.Left = printOptions.PageMargins.leftMargin
.Margins.Bottom = printOptions.PageMargins.bottomMargin
.Margins.Right = printOptions.PageMargins.rightMargin
End With
End Sub
Public Shared Function GetPaperSize(paperSizeId As Integer, defaultPrinterSettings As Printing.PrinterSettings) As Printing.PaperSize
Dim settings As Printing.PrinterSettings = defaultPrinterSettings
Dim result As Printing.PaperSize
If settings Is Nothing Then
settings = New Printing.PrinterSettings
End If
' Default paper Size defined in the printer
result = settings.DefaultPageSettings.PaperSize
For Each size As Printing.PaperSize In settings.PaperSizes
If size.RawKind = paperSizeId Then
result = size
Exit For
End If
Next
Return result
End Function
Public Shared Function GetPapersizeId(paperSizeName As String, defaultPrinterSettings As Printing.PrinterSettings Optional defaultpaperSizeId As CrystalDecisions.Shared.PaperSize = CrystalDecisions.Shared.PaperSize.DefaultPaperSize) As Integer
Dim settings As Printing.PrinterSettings = defaultPrinterSettings
Dim result As Integer = defaultpaperSizeId
If settings Is Nothing Then
settings = New Printing.PrinterSettings
End If
If Not String.IsNullOrEmpty(paperSizeName) Then
For Each size As Printing.PaperSize In settings.PaperSizes
' Height and Width in Printing.PaperSize is measure in hundredths of an inch
If size.PaperName.EqualsTo(paperSizeName) Then
result = size.RawKind
Exit For
End If
Next
End If
Return result
End Function
Setting the PrintOptions.PaperSize and PageOrientation seem like no effect on the viewer. My code to load the report to CR viewer is much more complicated than the code I show above, I've a background worker thread to download the report, and when the worker thread finished download the report from the server, it will assign the report to CRViewer. Do the changes in report PrintOption before assign to CRViewe and after assigning to CRViewer make any different?
I'm using VS2010, CR XI R2 (Version 11.5.3700.0). Please Help. Thanks
Regards
JC VoonHi JC,
CRXI R2 is a no go with VS 2010, these two are not compatible.
With CR 11.5 use VS 2005.
Or Use VS 2010 and CR for VS 2010 (13.0)
Once you have the supported / compatible conbination of CR and VS, use the In Proc RAS .NET code from below KBA.
http://search.sap.com/notes?id=0001561333&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303031353631333333
Also, see the KBAs returned by below search. The top right corner search box on this page is quite helpful.
http://search.sap.com/ui/scn#query=crystal%252C+paper%252C+orientation%252C+.net%252C+sdk&startindex=1&filter=scm_a_site(scm_v_Site11)&filter=scm_a_modDate(*)&timeScope=all
- Bhushan
Senior Engineer
SAP Active Global Support
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Getting started and moving ahead with Crystal Reports .NET applications. -
Crystal Report 2008 doesn't set page size when export to excel file
Hi,
I am using Crystal Report 2008 Developer edition.
At Crystal report design time setting the below page setup:
Page Options -
to A3(297X420 mm)
Orientation --- Landscape
and using the following code in .net (c#)
I am using below format options to export in excel in .net 2005
ReportDocument oReport = new ReportDocument();
oReport.FormatEngine.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
oReport.FormatEngine.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3;
if (aParamlist.ReportFormat == ReportFormatEnum.MicrosoftExcel)
ExcelFormatOptions excel = new ExcelFormatOptions();
excel.ExcelUseConstantColumnWidth = false;
// Use detail section one as a guideline to determine column width
excel.ExcelAreaGroupNumber = 1;
//excel.ExcelAreaType = AreaSectionKind.Detail;
excel.ExcelAreaType = AreaSectionKind.Detail;
// Prepare exporting options
ExportOptions export = oReport.ExportOptions;
export.FormatOptions = excel;
export.ExportFormatType = ExportFormatType.Excel;
oReport.Export();
when export to excel it doesn't set the Paper Size to A3(297X420 mm).
Is there any way to set the paper size while export to excel or in other formats also????
Thanks & Regds,Hi,
thanks for your email.
This is not happening in development environment.It is setting the paper size anf paper orientation properly.
this is happening in the production environment where only redist installation is done.
thanks -
How to set printersettings for the crystal report viewer in SAP BI dynamically
Hello
I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
Thanks & Regards,
Rajeswari.There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
Set As Default Crystal Report Layout in SAP B1 8.8 PL13
Hi,
I want to Set As Default a Crystal Report Layout. I know you can do that in Layout Desginer - Selection Criteria, but SAP B1 8.8 PL 13 has only a Manage Layout button in the Layout Desginer window which links to the Report and Layout Manager. There is no Set As Default button.
Where can you select which layout to be default in PL13?
Thanks!
CristinaHi
If you want to Set as Default particular PLD then Open that Form
For. Example
Sales Ar > A/R Invocies (Item) document
Then Click on PLD icon ans select your crystal report as Default by Set as Defaul button.
Thanks
King Kevin -
Trying to programmatically set the data-source for a Crystal reports report.
I've got the following existing procedure that I need to add to in order to programmatically set the data-source (server, database, username, and password) for a Crystal reports report.
I added the connectionInfo parts, but can’t figure out how to attach this to the existing
this._report object.
This is currently getting the connection data from the report file, but I now need to populate this connection data from a 'config.xml' text file.
Am I trying to do this all wrong?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CrystalDecisions.CrystalReports.Engine;
using WGS.Reports.Reports;
using CrystalDecisions.Shared;
using WGS.Reports.Forms;
namespace WGS.Reports
public class ReportService
ReportClass _report;
ParameterFields paramFields;
ConnectionInfo connectionInfo; // <- I added this
public ReportService()
public void DisplayReport(string reportName, int allocationNo)
if (reportName.ToLower() == "allocationexceptions")
this._report = new AllocationExceptions();
PrepareConnection(); // <- I added this
PrepareAllocationExceptionReport(allocationNo);
this.DisplayReport();
private void PrepareConnection() // <- I added this
//test - these will come from the config.xml file
this.connectionInfo = new ConnectionInfo();
this.connectionInfo.ServerName = "testserv\\test";
this.connectionInfo.DatabaseName = "testdb";
this.connectionInfo.UserID = "testuser";
this.connectionInfo.Password = "test";
this.connectionInfo.Type = ConnectionInfoType.SQL;
private void PrepareAllocationExceptionReport(int allocationNo)
this.paramFields = new ParameterFields();
this.paramFields.Clear();
ParameterField paramField = new ParameterField { ParameterFieldName = "@AllocationNo" };
ParameterDiscreteValue discreteVal = new ParameterDiscreteValue { Value = allocationNo };
paramField.CurrentValues.Add(discreteVal);
paramFields.Add(paramField);
private void DisplayReport()
frmReportViewer showReport = new frmReportViewer();
showReport.ReportViewer.ReportSource = this._report;
showReport.ReportViewer.ParameterFieldInfo = paramFields;
showReport.ShowDialog();
showReport.Dispose();
Any help would be much appreciated.Hi Garry,
Please post SAP Crystal Reports questions in their own forums here:
SAP Crystal Reports, version for Visual Studio
We don't provide support for this control now. Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Crystal Report Page Setting In Browser
Hello all,
I have designed my Report In Crystal-9 and using jar files i have linked it to My web Page Now My Problem is , am getting proper preview in Crystal Report preview , But when am seeing same report in Webpage only half of my report is visible
My Page Setting in designing mode as follows
Print Setup:-FanFload 358*305 mm
Orentation:- Portrait
and i have desgined this report to take Print in DotMatrix-EPSON-2175 printer.
Hope u understood my problem,
Thanks in advance
Vanishree.B.RaoHi All,
My Problem is Solved ,
OK here I tell u wat i did, Am using eclipse as my editor , so i opened my report in eclipse and went to properties and there page setting and there i have chosen custom option and i have given the page height and width,
Hope this solution ill be usefull to some one,
Thanks ,
Vanishree.B.Rao -
How to save Database Configuration setting to a Crystal Report Instance
Hello,
I'm using .net c# to create and run a schedule of a crystal report.
I'm able to connect to BOE and succesffuly create the schedule instance and pass the parameters. but it's failing to run because I'm not providing it with the Database Logon credentials.
I know there is a way to set the database confiuration on the report in CMC, but we don't want to do that so we can have a trail of who ran the report. We want to pass that through code when scheduling an instance. Can someone tell me how to do so.
Thanks!ceReportObjects = ceInfoStore.Query(sQuery);
//check for returned reports
if(ceReportObjects.Count > 0)
ceReportObject = ceReportObjects[1];
ceReport = (Report)ceReportObject;
//grab the report logons
dbLogons = ceReport.ReportLogons;
dbLogon = dbLogons[1];
//set custom values
//** NOTE: **
//The easiest way to determine the proper custom logon values is to
//successfully set custom logon values through the CMC first, then
//transpose those values to this application
dbLogon.UseOriginalDataSource = false;
dbLogon.CustomDatabaseDLLName = "crdb_ado.dll";
dbLogon.CustomServerName = "servername";
dbLogon.CustomDatabaseName = "database";
dbLogon.CustomUserName = "username";
dbLogon.CustomPassword = "password";
dbLogon.TableLocationPrefixes[1].MappedTablePrefix = "DatabaseName.dbo.";
dbLogon.TableLocationPrefixes[1].UseMappedTablePrefix = true;
//Create an interface to the scheduling options for the report.
SchedulingInfo ceSchedulingInfo;
ceSchedulingInfo = ceReport.SchedulingInfo;
//run the report right now
ceSchedulingInfo.RightNow = true;
//run the report once only
ceSchedulingInfo.Type = CeScheduleType.ceScheduleTypeOnce;
//schedule report
ceInfoStore.Schedule(ceReportObjects);
Taken from a sample contained [here|https://smpdl.sap-ag.de/~sapidb/012002523100005921432008E/bexi_csharp_smpl.zip] -
Crystal Report with text(csv) data file, can we set it as input parameter?
Hi,
I am a new user of Crystal Reports 2008.
I have created a report with charts in it. The input data comes from a csv text file.
Can I set the name of this text file as an input parameter?
as I need to generate 44 similar reports with different text filenames(and data)?
Thank you.
RegardsBrian,
Thanks much.
I did exactly what you said.
Just to see any change, I first gave a bad report file name just to see if I am accidentally pointing to a different file,
but I got an error saying report not found.
Then I renamed my original datafile name and generated a report and it still generated one without giving an error.
Then I also gave a junk name to the logoninfo and printed that name, the new name was assigned to logoninfo, but the code did not error out.
It ended up generating the report.
Now here is what I think is happening,
1) The save data in report option seems to be still on even though I have turned it off in 2 locations
a) file -> Report Options
b) file -> Options -> Reporting tab.
2) For some reason the logoninfo is getting ignored as well.
Since I did not see any answers yesterday I posted a link to this thread on the .Net forum
Crystal Report with text(csv) data file, can we set it as input param? C#
and Ludek Uher says that I am connecting to the text file via a DAO database engine and so need to use the same code for changing the text file as for changing an Access database.
But the link he gave me tells me to try the same thing that we have been trying..
Here is my plan,
1) I will first try and find out why my save data with report option is still on ( but it shows off in Crystal ).
2) why is LogonInfo getting ignored.
Meanwhile any suggestions from anyone are welcome. -
Crystal Report with text(csv) data file, can we set it as input param? C#
Hi,
I am new to the forums and posted a question which belonged to the .net - SAP Crystal reports group.
Can someone help me with my problem? following is the thread that I have started.
Crystal Report with text(csv) data file, can we set it as input parameter?
Thank you in advance.Looking at the original thread, you are connecting to the text file via the DAO database engine:
"I added the text file as follow, new connection -> Access/Excell (DAO) -> select the file and the database type as text"
Thus I would use the same code for changing the text file as for changing an Access database. See Kbase [1218178 - Error: "Logon failed" when connecting to Access database in .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333133373338%7D.do] for more information. If that does not work, you may want to consider connecting via ODBC or feeding the data from the text file to and ADO .NET dataset and pointing the report at the dataset.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]
Maybe you are looking for
-
How to configure multiple IP-Adresses on one NIC in OVM
Hi guys, we have some OVM Servers 2.2.1 installed. They all have three NICs in them (eth0-2). For eth0 and eth2 we need multiple IP-Adresses configured to work with our storage solution. The configuration should look like this: eth0:0 - 192.168.31.x
-
Hi All, I am using Labview8.5 and Windows XP OS. My Problem is my Labview TimeStamp cannot display current system date and time. Please see my attachment for the screentshot. The TimeStamp or ever Format Date/Time String display "YYYY-MM-DD" instead
-
Apply existing styles to paragraphs
I have a small problem. How to apply existing styles. Different style to the first, second and third paragraph of the story/selection. I think it's simple, But I can not solve the problem. Thank you.
-
Hi all, I'm moving out of my family home into a rental flat with my partner at the end of this month. I'm looking to get a NEW bt infinity connection organised for the day we move in (or the day after at the latest). Ive already checked availability,
-
I've just burned a first dvd with my new mac book pro and final cut express upgrade. The video shows jagged edges all through. It seems fine in the editing program and viewing in the dvd. What can I do to correct this problem. sputnik