How to center the content in crystal report viewer?

open crystal report viewer in winform, default at the left top
after maxmium the winform window, content become at the center
another odd thing is that i set window winform size 1208*1024 and crystal report view is fill
then tried, content is not center any more
How to center the content in crystal report viewer in code?
Edited by: Mathew_666 on Oct 6, 2011 5:20 AM

Since there is no control for center you'll need to do the math on your own. This is just a rough draft, but you'll get the idea.
One of the things you'll need to figure out is your buffer to help you give a centered feel. We'll say that value is 50 in this case.
Height
int buffer = 50;
int formHeight = 1000; // we'll assume a height of 1000 in this case
int crystalTop = buffer;
int crystalViewerHeight = formHeight - (buffer * 2); // buffer is at the top and bottom
Width
int formWidth = 1000; // we'll assume a width of 1000 in this case
int crystalLeft = buffer;
int crystalViewerWidth = formWidth - (buffer * 2); // buffer is at the top and bottom

Similar Messages

  • How to use the DLL in crystal report (Additional applications)

    Hi,
    i have created a win32 dll, and now i want to use that dll in my crystal report how can i do so?, what i tried is i went to to Addntional functions catagory in formula workshop, and there i can see some dlls listed, similary i put my dll in the same path like "C:\Program Files\Common Files\Crystal Decisions\1.0\Bin" and other folder too. but i am not able to see that dll in "Addtional functions". can you plesase tell how can i achive this.
    Regards,
    Prabhakar J.

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to change the database in Crystal reports

    To give an overview there is one project going on where the oracle database is getting migrated from 10g to 11g.
    All the details of database like IP, port etc are changing as part of this.
    I can see the driver name configured as crdb_ado (Custom driver).
    We have an test environment for 11g against which we have to point all the reports and test it.
    Could you please let me know the below queries
    Where and how to change the IP details in the crystal reports to point to new test and prod databases.
    Overview on this crdb_ado driver
      Basically the database is getting changed and we want the reports to point and run from the new database.
    Thanks

    Hi Vissu,
    Thanks for your reply.
    We need to change the database from the reports which are already running from central management console.
    I can see a custom driver crdb_ado is being used and it connects to a database.
    Could you please let me know where the database configuration is done.
    Ideally we need to add one more database to a config file which i am not able to find.
    I guess it should be similar to tnsnames.ora file in oracle where the different databases are stored.
    From the above image I would like to know where the server details (NECTAR_Prod) would be configured.
    Thanks in advance

  • How to optimize the performance of crystal report?

    Hi,
    -I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    -Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    -Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    -Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    -To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    -For time Field I have created two sub reports, one for chart and other one for details in the same way described in point one(Printing 1 million recordsu2026u2026).
    After implementing these points my crystal reports performance improved drastically. The report that was taking 24 minute to come back now taking only 2 minutes.
    However I want my report to come back with one minute. It returns if I remove the sub reports for Time Based Grouping but I can not do so.
    My questions here are,
    -Can I stop Subreport from fetching the data from DB if itu2019s suppressed?
    -I believe using Conditional Template Object is a better option rather than having multiple detailed sections to print the data for a selected Group. However any suggestion here to improve the performance will be appreciable.
    -since crystal report does not provide any option to limit the number of records to be fetched from DB, I am forced to use command object with rownum in where condition.
        Please let me know about other option(s) to get this done...If there is any.
    I am using Crystal report 2008.And we have developed our application the use JRC to export crystal report in PDF.
    Regards,
    Amrita
    Edited by: Amrita Singh on May 12, 2009 11:36 AM

    1) I have to design a crystal report with best possible optimization. Optimization is main concern since report will run against 1-2 million data set. Though I am using parameter to fetch only the required data, required data can go till 1 million records.
    2) Based on the input passed by the user I have to group the data in report. And for each selected parameter the Detail section I am printing is different. For example:-If user selects store then detail section is different and if user select Host then detail section will be different.
    3) Report can be grouped by Time Field also. So to full fill this requirement I would have to create a sub report since other parameters are of string type and can be used in one formula to get parameter based grouping in report. However If I try to return Time filed from the same formula I get the errors the "Return type should be of String typeu201D. This forces me to create sub report for Time based grouping. If user selects Time Field to be grouped on, all the information in the main report gets suppressed and only the sub report gets printed.
    If user select store, Host and User in parameter to be grouped on, sub report gets suppressed.
    Now with the above mentioned points I tried to optimize the report in following way.
    1) Printing 1 million records in the report does not make sense; hence we wanted to show the summary of all the records in chart section but wanted to print just 5000 records in detailed section. Suppressing detailed section after 5000 records does not help much since suppressing just saves the time in printing and does not limit the number of records to be fetched from the DB.I have a subreport also so it fetches the data 2 times from the DB hence makes the performance of the report worse.
    To solve this problem I used command object and put the charts in the subreport and detail in main report.
    In main report's Command Object I limited the number to records to be fetched from the DB to 5000 using rownum<5000 but in subreport's Command Object I did not set any limit in the query but I am doing all my aggregation in SQL which means do summary operation in DB and get only summarized data from DB.
    2)To solve section problem I am using Template object (new feature added in CR 2008).In which I am returning the field based on the "Group By" parameter selected by user.
    Edited by: Amrita Singh on May 12, 2009 12:26 PM

  • How to center the content of GridViewColumn in code behind?

    Hi all,
    This seems pretty simple to do in xml but I can find a way to do this in code. I'm using this to write to a FixedPage in an xps document and I need the content of the columns centered. Is this even possible?
    Thanks
    ListView myListView = new ListView();
    GridView myGridView = new GridView();
    GridViewColumn gvc1 = new GridViewColumn();
    gvc1.DisplayMemberBinding = new Binding("FirstName");
    gvc1.Header = "First Name";
    gvc1.Width = 100;
    // I need to center the column content!
    myGridView.Columns.Add(gvc1);
    List<DataItem1> xcv = new List<DataItem1>(5);
    xcv.Add(new DataItem1 { FirstName = "John" });
    myListView.ItemsSource = xcv;
    myListView.View = myGridView;

    Just create an ListViewItem style with the HorizontalContentAlignment property set to Center and set the ItemContainerStyle property of the ListView to this one:
    ListView myListView = new ListView();
    ListViewItem lbi = new ListViewItem();
    Style ics = new Style(typeof(ListViewItem));
    ics.Setters.Add(new Setter(ListViewItem.HorizontalContentAlignmentProperty, System.Windows.HorizontalAlignment.Center));
    myListView.ItemContainerStyle = ics;
    GridView myGridView = new GridView();
    GridViewColumn gvc1 = new GridViewColumn();
    gvc1.DisplayMemberBinding = new Binding("FirstName");
    gvc1.Header = "First Name";
    gvc1.Width = 100;
    myGridView.Columns.Add(gvc1);
    List<DataItem1> xcv = new List<DataItem1>(5);
    xcv.Add(new DataItem1 { FirstName = "John" });
    myListView.ItemsSource = xcv;
    myListView.View = myGridView;
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • How to Adjust the field in Crystal report

    hi experts
    In Sales Quotation i haved created 16 number of user defined fields which they can enter the data in that for one quotation the characters are 189 and for another quotation there are 1245 characters if i preview the lay out the field getting over lapped can any one help me how to rectify the issue with out ove lappind
    Regards ,
    Meghanath.S

    Dear $riniva$ Rachumallu
    If we do that the below field is getting over lapped

  • How can I get the View Tab name on the Crystal Report Viewer at runtime?

    When a report is displayed in the Windows Forms Crystal Report Viewer and the user drills into the report, the drill down view is displayed in a seperate view and is identified via a View tab at the top of the report.  I can determine the index of the view tab that is currently selected, but I need to access the text that is on the View tab.  The only properties that I've found that pertain to the "view" on the Crystal Report viewer are the ActiveViewIndex and the ViewCount.  Unfortunately, neither of these items help me because they are not specific to a certain section of the report.  Has anyone had any luck accessing the View Tab properties ?  Thanks.

    The tabs at the top of the page are nested within some of the viewers controls. Through trial and error you just have to find the right one. In this case the main part of the report is in the first control. This happens to be a TabControl. From there you can loop through the TabPages on the TabControl to grab the names of the tabs.
    Here is a quick example of what I did to get the tab text. All this code was in a button click event.
    Control oControl = crystalReportViewer1.Controls[0];
    TabControl oTabControl = (TabControl)oControl.Controls[0];
    foreach (TabPage oTabPage in oTabControl.TabPages)
         MessageBox.Show(oTabPage.Text);

  • How to assign a variable value to crystal report viewer formula with CR2008

    Hi ,
    I am using crystal reports 2008 and i am not able to find how to assign  variable value  to crystal report viewer formula.
    In CR 8.5 , i used to have crystalreport1.Formulas(0) = variable1
                                             crystalreport1.Formulas(1) = variable2
    but, i don't find similar kind  in crystal reports 2008.
    How can i achieve the same functionality using crystal reports 2008.
    Thanks in Advance
    Regards,
    Ramnath

    Hi,
    Can i anyone help me out with this.
    I am generating crystal reports in vb6 using CR 8.5 and vb6 and below is the code snippet for the same
    CrystalReport1.Formulas(0) = "PrintTitle= '" & strMyTitle & "'"
    CrystalReport1.Formulas(1) = "FromDate= '" & MskFromDate.Text & "'"
    CrystalReport1.Formulas(2) = "ToDate= '" & MskToDate.Text & "'"
    Please let me know how the same functionality can be achieved in VB.Net using Crsytal reports 2008
    Any code snippet would be of great Help.
    Thanks in Adnvance.
    Ramnath

  • The Crystal Report Viewer is unable to create its resource objects

    Recently our Clients have updated to Windows 7 and IE8. we are having issues to view the Reports in Infoview.
    The web server operating server is Windows 2003, Crystal Reports XI Release 2  and BOE R2 SP2 is installed in it. Activex Viewer is downloading fine in client machine having Windows XP OS (IE Version is 7) but for the same url ActiveXViewer.cab is not getting downloaded in Windows 7 Enterprise (IE Version is 8). It throws the error u201CThe Crystal Report Viewer is unable to create its resource objects.u201D
    Does BOE R2 SP2 support on IE8?
    Thanks

    Tested Windows 7 And IE8 browser to view Reports in Infoview for different user preference setting.
    1.       Active X Viewer u2013 Fails to open in View Mode and errors out with message as u201CThe Crystal Report Viewer is unable to create its resource objectsu201D
    2.       DHTML Viewer u2013 Could able to open/export/print  the Report.
    3.       Advance DHTML Viewer  - Could able to open/export/print  the Report .
    4.       Java Viewer u2013 Could able to open/export/print  the Report, but noticed the fonts are overlapping.

  • Crystal reports and crystal report viewer

    Hi.
    I have up to recently used crystal report version 11.5 and reports have been made available for users in the organisation via Crystal report viewer.2010 ver 11.2.1.3.
    The reports have been saved without data, and the different parameters have been available for the users for them to select approriate dataset,.
    I have now upgraded Crystal reports to version 2013 ver 14.1 and crystal report viewer to same version.
    The problem now is that the parameters are no longer available for the users, and it is also a requirement to save the reports incl a dataset to even open the report in the new report viewer.
    What have I missed? Anyone that can help me ?
    brgds Torunn

    Hi Torunn
    An alternative may be to create a web app using either the Crystal Reports .NET or Java SDK. Depending on what development software you already have, this may be cheaper than CR Server or "BO server". E.g.; both the .NET SDK and the Java SDK are free:
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    SAP BusinessObjects - SAP Crystal Reports, Version For Eclipse Download
    The above would be predicated on the assumption  that your org has some developer experience (or is willing to acquire it) and that you have the development software (e.g.; VS 2010, or 2012, or 2013 for the CR SDK for .NET).
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • WPF Styles and WPF Crystal Reports viewer

    Hi,
    We are currently developing a WPF application which will utilize Styles created with Expression Blend.
    Our environment is VS2010 SP1 and Crystal Reports for VS2010 SP2.
    We want to design our reports with Crystal Reports but we don't seem to find any documentation or topics about integrating WPF Styles with the current WPF Crystal Reports Viewer.
    So I was wondering if somebody here already tried to use WPF styles with the WPF CR Viewer.
    If so, how does it basically work?
    Thank you in advance.

    Hello Alan
    This morning I got a short note on the issue from Program Management. In a nut shell this is what they say:
    ..at this time the WPF viewer doesn't expose support for styles and the best thing will a post
    to the idea on [SAP IdeaPlace|SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]. Based on the interest level expressed there the PM group will make a decision on how best to proceed.
    Obviously, this is not going to be a swift process, but at least something...
    - Ludek

  • Crystal Report Viewer and Windows 7 Enterprise

    Hi,
    We are using RDC methodology for launching the crystal reports in the web using ASP. 
    The web server operating server is Windows 2003, Crystal Reports XI Release 2 is installed in it. Activex Viewer is downloading fine in client machine having Windows XP OS (IE Version is 7) but for the same url ActiveXViewer.cab is not getting downloaded in Windows 7 Enterprise (IE Version is 8).  It throws the error u201CThe Crystal Report Viewer is unable to create its resource objects.u201D
    To download the cab file in Windows 7 machine it request for the following url
    1.     http://<web server name>/crystalreportviewers115/ActiveXControls/ActiveXViewer.cab
    2.     http://crl.verisign.com/pca3.crl
    3.     http://csc3-2004-crl.verisign.com/CSC3-2004.crl
    4.     http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab
    URL 2,3,4 returns the http status as 502 (Bad gateway).  These url are not called from the Windows XP machine.
    The windows 7 client machine is not connected to the internet. I tried importing the crl files (by downloading from another machine).  But still we are getting the same error.
    How to over come this issue?
    Please Note :
    1. I am able to download the cab file when I tried to download only the cab file directly by specifying the cab url.
    2. If I am registering the ActiveXViewer.cab deliverables manually in the client machine report is launching fine, but we cannot do the same for the entire client machine having Windows 7 Enterprise Operating System.

    Hi Ludek Uher,
    Thank you very much for the information provided by you.  But still the same error (The Crystal Report Viewer is unable to create its resource objects) occurs after changing the IE8 Compatibility mode.
    Are there any other settings that can be tried for this issue?
    Thank You.

  • Install configuration for Crystal Reports Viewer 2011

    Hi,
    Is there any way to configure the defaults for Crystal Reports Viewer 2011 as part of the installation routine?
    Specifically we would like to:
    1. Switch off the attempt (on launch) to make an internet connection for community resources
    2. Hide the side bar unless the user actually goes into the view menu to turn it on.
    There's various reasons for this, but mostly it's that to get an internet connection the application has to go through the proxy server - we would rather that sort of activity was instigated by the end user on demand, not an application automatically, not least in this case because the license agreement window seems to be set to force itself to the 'front', which covers the proxy server prompt, so we can't write a script to provide automatic authentication without user intervention. It would be far better if there was a way to simply switch off this feature - and at the same time set the default 'view' settings to hide the side bar in the first place.

    Hi,
    Do you mean the Standalone Crystal Reports Viewer 2008: http://www.sap.com/solutions/sapbusinessobjects/sme/reporting/viewer/index.epx
    If you do then you can perform a slient install by following the instructions from the release notes:
    http://help.sap.com/businessobject/product_guides/crv2008/en/xi3-1_crviewer_release_en.pdf
    Those notes are provided from this webpage:
    http://help.sap.com/content/bobj/bobj/index.htm

  • Crystal Report Viewer Export options

    In the toolbar of Crystal Report Viewer, there is export button, click it it will pop-up the file dialog for you to choose the export format and dist file location.
    the default(first choice) export format in CR2008 is ".rpt", , how can I set the default export format to ".pdf"?
    Thanks for help.

    Remove the viewer Export button from the toolstrip
    Add a new Export button
    On click event of the new Export button, present the user with custom export form
    Use the following sample code
    Private Sub frmReportPreview_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim ts As ToolStrip       
    Dim currentExportButton As ToolStripButton       
    Dim newExportButton As ToolStripButton
    ' Replace the export button with our own export button so we can handle the event ourselves
    ts = DirectCast(CRViewer.Controls(4), ToolStrip)       
    currentExportButton = DirectCast(ts.Items(0), ToolStripButton)
    ts.Items.Remove(currentExportButton)       
    newExportButton = New ToolStripButton("", My.Resources.Export, AddressOf ExportButton_Click)
    newExportButton.ToolTipText = "Export report to disk"       
    ts.Items.Insert(0, newExportButton)
    End Sub
    Create windows form 'frmReportExport' that contains the export file types and their order, then use the following code:
    Private Sub ExportButton_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim frmExport As frmReportExport
    ' Allow the user to specify options such as the name of the file and format before exporting.
    frmExport = New frmReportExport       
    frmExport.Report = Report       
    frmExport.ShowDialog()
    End Sub
    Then use the code below to run the export from the custom report export windows form.
    Report.ExportToDisk(exportFormat, fileExport.SelectedFilename)
    Please do note. This is an unsupported, undocumented hack of the viewer. This may work for your current app, but you risk that the same approach may not work in future versions of the viewer...
    Ludek

  • Crystal Report Viewer Control error

    Please Help, I have a web application developed in .net 2005 which is using crystal reports developer product version 10.0.0.533.
    This web application with crystal is working fine on my local machine with OS windows xp, but on the windows server 2003 the application web form is running into "couldnot load file or assembly 'CrystalDecision.VSDesigner, Version=10.0.0.3300' or one of its dependencies"
    I have compared the assembly information of my local machine with that of the server and could not see the crystaldecision.vsdesigner version 10.0.0.3300 on the server 2003. I have uninstalled microsoft .net 2005 and crystal reports and installed crystal first and visual studio .net 2005 next and vice versa but still could not see that particular assembly available in the windows 2003 server.
    Please suggest as what to do for the assembly to be available on the server so crystal report viewer control can be created with out error. Thanks for any help.

    Hello Sunitha,
    Visual Studios 2005 ships with a bundled edition of Crystal Reports.  This bundled edition is based on the v10 code stream, but it is not CR10.  It's CR.NET for Visual Studios and it's v10.2. Crystal Reports 10.0 and the bundled CR.NET 10.2 for VS2005 are not interchangeable.
    The stand alone version of Crystal Reports 10 is not expected to integrate correctly into VS2005.  If you have CR10 Developer installed on your VS2005 machine you can force VS2005 to use the CR10.0 assemblies, but it is not supported.
    You need to clean up your application so that it's referencing the 10.2 version assemblies and then deploy the 10.2 runtime files.  You can visit the [Crystal Reports for Visual Studio .NET Runtime Distribution - Versions 9.1 to 12.0|https://www.sdn.sap.com/irj/scn/wiki?path=/display/bobj/crystalReportsruntimeforVisualStudio.NET] Wiki for a nice overview of the various versions of Crystal Reports, as well as a listing of the runtime files to match the version of Crystal Reports that is being used.  For VS2005 and bundled CR.NET look at the "CR 10.2 (VS .NET 2005)" section of the Wiki.
    Sincerely,
    Dan Kelleher

Maybe you are looking for

  • Mismatch of BP number.

    Hi My client system have  practice like initially BP is created in CRM, then it will be created in R/3 with same number. In ECC number range is external and in crm it is internal.  But in one case by mistakenly user created sold to in r/3 as 3333, th

  • Sent messages lost

    please help.... this is the second time i have lost all my SENT emails... very disturbing since i often need to go back on what i wrote and quotes past.... when i right click on sent and properties in my local file folders... it tells me there are 15

  • How do Dictionaries Work Within and Between a Class?

    I am attempting to understand the connection between the dictionary and the class. In the code below a dictionary is established in the Assets class. This class manages all of the assets in the project. Other classes can request the images in this As

  • Optimizing data grouping on BMM Layer

    Hi. I'm faced with the next task. *(1)* Business goal Display number of customers registered and activated by periods. The request in Answers should contain: *{Period, NumberOfContacts_Registered, NumberOfContacts_Activated}* *(2)* At Physical Layer

  • Battery Life of Macbook Pro OS X ML

    Is it normal for Macbook Pro OS X ML battery to discharge even when it is off? I noticed my battery discharges from 100% to 96%  even if it was turned off overnight. I noticed also that when I'm using my laptop just for emails battery drains so fast