Dynamic crystal report generation - issues with column headings

Hi All,<br>
I'm trying to generate a crystal report dynamically based on a "result set" data(Query: select REPORT_ID, REPORT_NAME, REPORT_DESC, RPT_FILE_NAME, LOCATION from IRS_REPORT_DETAILS). I'm able to generate the report run time, But the report is without columns heads. I would like to include the column headings as well. <br><br>
I searched the API(RAS) and found that there is a 'add(java.lang.String fieldName, java.lang.String headingText) " method present in "ReportObjectController" using which we can add the headings.<br><br>
ReportDefController reportDefController = clientDoc.getReportDefController();
ReportObjectController reportObjectController = reportDefController.getReportObjectController();
reportObjectController.add( "{Table.Field}", "FieldName" );
<br><br>
I'm facing problems in using this code. When trying to use this function for my fields(Ex: reportObjectController.add( "{ IRS_REPORT_DETAILS.REPORT_ID}", "Report ID" );) it is giving me the following error:<br><br>"com.crystaldecisions.sdk.occa.report.lib.ReportSDKGroupException: The field was not found.---- Error code:-2147213310 Error code name:fieldNotFound"<br><br>
<b>The following is my dynamic crystal report generation code:</b><br><br>
public ReportClientDocument execute(String repName, String query) {
          ReportClientDocument boReportClientDocument = null;
          try {
               boReportClientDocument = new ReportClientDocument();
               boReportClientDocument.newDocument();
                  // Add a table based on the given Resultset to the report.
               dbConnResultSet mySampleResultSet = new dbConnResultSet();
               //mySampleResultSet.execute(query);
               boReportClientDocument.getDatabaseController().addDataSource(
                         mySampleResultSet.execute(query));
               IReportSource test = boReportClientDocument.getReportSource();
               // Access all the database fields
               DatabaseController databaseController = boReportClientDocument
                         .getDatabaseController();
               IDatabase database = databaseController.getDatabase();
               Tables tables = database.getTables();
               ITable table = (Table) tables.getTable(0);
               int NO_OF_FIELDS = table.getDataFields().size();
               int LEFT_POSITION = 200;
               // Add all the database fields to the report document
               for (int i = 0; i < NO_OF_FIELDS; i++) {
                    IField field = table.getDataFields().getField(i);
                    FieldObject fieldObject = new FieldObject();
                    fieldObject.setFieldValueType(field.getType());
                    fieldObject.setDataSource(field.getFormulaForm());
                    IReportObject rep = (IReportObject) fieldObject;
                    IObjectFormat objformat = rep.getFormat();
                    objformat.setEnableCanGrow(true);
                    objformat.setHorizontalAlignment(Alignment.from_int(1));
                    rep.setFormat(objformat);
                    rep.setLeft(LEFT_POSITION);
                    rep.setWidth(1000);
                    LEFT_POSITION = LEFT_POSITION + 1000 + 50;
                    ISection section = boReportClientDocument
                              .getReportDefController().getReportDefinition()
                              .getDetailArea().getSections().getSection(0);
                               //***************** Data being added to the report here, But headings are not added*****************
                    boReportClientDocument.getReportDefController()
                              .getReportObjectController().add(rep, section, i);
               boReportClientDocument.createReport();
               /*Some report saving code is present down*/
          } catch (ReportSDKException ex) {
               ex.printStackTrace();
          } catch (Exception ex) {
               ex.printStackTrace();
          return boReportClientDocument;
<br><br>
appreciate your help.

IField field = table.getDataFields().getField(i);
Here you are getting the first field in the array.  This may not be the field you want to add since we aren't sure how the arrays are ordered when retrieving fields from the report.  It is better to retrieve the fields with the findObjectByName method, thus ensuring you are retrieving the field you want to add to your heading.

Similar Messages

  • Report generation issue with a hut

    Hi,
    I hav an issue using report generation my report is using huts and I i'm writting true or false value in excel case, which is linked with the hut but writting the value in the linked case does not change the hut value.
    Thanks
    Olivier

    Hi Olivier,
    I was wondering if you could expand on what the overall goal for your application is.  Also I am not familiar with huts, could you explain what these are?
    Eric A.
    National Instruments
    Distributed I/O Product Support Engineer

  • Crystal Reports Charting Issue with SAP Function Module

    I created a custom SAP Function module that returns 2 tables. The first table (summary table) contains two columns, column "a"  contains a grouping and column "b" is a quantity.  The second table is the detail and is linked to the first table by the grouping, column "a" , in both tables.  I can bring the function module into Crystal Reports, but cannot create a drill down using a pie chart off the summary table.  When I go into the Chart Expert - Data Tab only the Advance button is active and the Group, Cross-Tab, and OLAP buttons are deactivated.  First of all, is it possible to do this using a SAP Function Module, if yes, what am I doing wrong.

    hello Jhess,
    i am not sure if you found an answer for your question yet. if you have a Group and a Summary on your report (i.e. the Sum of your Quantity field) then group charts should be enabled.
    cheers,
    jamie

  • Crystal Reports Plugin Issue with MyEclipse Blue 8.6

    Dear All,
    I am trying to integrate Crystal Reports Plugin with MyEclipse Blue 8.6
    As i add the update site and i say Apply Changes to Profile, it calculates the requirements
    and in the middle hangs. Please advice, is this version not compatible with MyEclipse Blue
    8.6?
    BR,
    Prithvi

    Dear Herman,
    I am using 32-bit JVM not 64-bit, still it hangs. Any other work around.
    Prithvi

  • Does anyone have a report using cfdocument that produces a ledger type report with column headings?

    I need to see some sample source code of a report with column headings and detail data.  I can't get my column titles in the header to line up with the detail no matter what I do.  Can anyone spare me a good sample?
    I have tried to use tables to specify both col headings and detail, but no chance to get them to line up.  There has to be a way.  I can't use the report builder because I need more control of when page breaks print, what data is on each line, etc.  Hopefully some kind soul out there has a good sample.
    Thanks!
    Dave

    Your MBP is actually a mid-2010, not a 2008. That's what the 6,2 model indicates.There's an issue with the graphics module on that machine. There was a program in place to replace the motherboard within 3 years of purchase, but you're probably outside of that. Some folks have supposedly gotten theirs changed outside of that period, so you can try.
    http://support.apple.com/kb/TS4088?viewlocale=en_US&locale=en_US
    What you can do to use it is download gfxstatus from http:gfx.io and force the graphics to Intel. That would affect your work with Final Cut, but at least you might be able to use the machine.

  • Problem with crystal report that comes with VStudio 2008 Database edition

    Hello,
    I'm using crystal reports that comes with Visual Studio 2008 Database edition. But I'm having a problem these days. When there are more than 4 pages in the report, the summary field in the pagefooter(usually sum of data in the Details section) show 0 in the first page.It will be displaying in all other pages. I couldnt sort out the problem.I'm binding data to the report from an SQL Server 2005 table.
    Thanks in advance.I really appreciate if some one can sort out the problem quickly.

    Have not heard of the issue, but download SP1 and see if that helps:
    https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • EOS / EOL / PSIRT report generation Issue

    HI All ,
    I am using lms 3.2 with RME 4.3.0
    Recently i have seen 2 bugs related with EOS/EOL /PSIRT report generation issue
    CSCta76147
    CSCtc36563
    The status of the bug is given as  Fixed(verified )
    Status
    Fixed
    (Verified)
    Severity 3 - moderate
    Last Modified
    In Last Year
    Product
    CiscoWorks Resource Manager Essentials
    1st Found-In
    4.1
    4.3
    Fixed-In
    5.0
    Component(s)
    eoxpsirtreports
    Here the fixed release is given as 5.0 , can anyone please tel me where to get the 5.0 version for download .
    ( Is the 5.0 the LMS version or the RME version  )
    When i am trying to generate EOS/EOL report,  i am getting error saying check the connectivity to cisco .
    Regards
    Angus

    HI Afroj ,
    When i am running the EOS/EOX or PSIRT report the job status is showing running but its not getting stoped .
    I tried using the local option  , downloaded the offline file from the below link and  placed in
    NMSROOT\files\rme\jobs\inventory\reports\EOX_PSIRT\local_xml
    "http://tools.cisco.com/support/downloads/go/ImageList.x?relVer=4.1.1&mdfid=282635175&sftType=CiscoWorks+Resource+Manager+Essentials+Patches&optPlat=Solaris&nodecount=2&edesignator=null&modelName=CiscoWorks+Resource+Manager+Essentials+4.3&treeMdfId=268439477&treeName=Network+Management&modifmdfid=&imname=&hybrid=Y&imst=N&lr=Y
    even then the job is running continuously its not stopping .
    I have a RME version 4.3.0
    Kindly let me know what i am doing is correct .
    Regards
    Angus

  • Link to report an issue with Podcast update

    Someone posted a link so we could report an issue with the Podcast app the last time there were issues with an upgrade.
    I sync with my laptop iTunes. Since this latest update to the app, when I delete a podcast in iTunes on my laptop it will not delete on my i devices during a sync with my laptop. It just grays them out and leaves them on my device. It looks like I can manually delete them, but when you click the edit function to delete them, they are no longer grayed out, so you can't tell which to delete and which to keep.
    I don't do anything with the cloud, because I have limited wifi service and do most of my updating at a free wifi hotspot.
    If someone has that online link on where to report issues, I would appreciate you posting it again and this time I will save it.

    To Contact the Mac App Store Customer Service:
    http://www.apple.com/support/mac/app-store/contact.html?form=account
    To Contact iTunes Store Customer Service:
    Apple - Support - iTunes Store - Contact Us

  • Report generation issue

    what are the diff report generation issues?

    Nvm, solved it just had to set up Reporting studio in order to create an accurate report.

  • Report generation toolkit with openoffice

    hello all
    i would like to know if it is possible to use the report generation toolkit with openoffice instead microsoft office? because i do not have the toolkit already i can't test it and i will only buy it if this is possible...
    i ask also because i used another application with word export not long ago what was ending with the error message "windows ole server not found". so the question is if something of the microsoft product line is necessary? i am quite sure that the opening of a produced doc would be possible in openoffice without problems - at least i hope so!
    only one thread i found, unfortunately in french : http://forums.ni.com/ni/board/message?board.id=4170&message.id=13060&query.id=139594#M13060
    thanks a lot, mischl

    Another option to consider is to use the report generation VIs that ship with LV and simply output to a PDF document rather than a hardcopy printer.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Crystal Report 9 connectivity with WebLogic 10.3.5

    Hello,
    Is the Crystal Report 9 certified with WebLogic 10.x? Currently WebLogic 8.x is in use. Trying to upgrade the WebLogic.
    Thanks

    What does this have to do with Database Connectivity?
    An I doubt it, CR 9 is about 8 or 9 years old well before 10.3 was released. Check the Platforms PDF's for more info.
    Don

  • How to get one crystal report to work with two different backends?

    We have a software that can work with either SQL2008 or Visual Fox Pro backend.  We are trying to compile One Crystal report that will work with either of the two backends.  How to you make sure that your Crystal Report is compiled so that it will work with both backends?
    Right now my reports were originally created using the SQL2008 backend and are retaining the DBO reference in the statement, which then will not allow the Crystal report to work with the VFP backend.

    You can write your data sets as a command using hand coded SQL. As long as "dbo" is the only schema used in your SQL Server database, you don't need to specify it in the SQL. SQL Server will automatically assume the dbo.
    The 2nd thing... The SQL needs to be 100% compatible with both SQL Server 2008 AND VFP.  This will limit the list available functions to those that are common to both platforms AND work exactly the same in both platforms.
    The other part is to make sure you are using an ODBC type connection instead of OLD/DB. That way all of the connection properties are set on the local machine and the report is simply looking for the System DSN name.
    HTH,
    Jason

  • Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Numbers does not have rotated text within cells.  You can place a text box over the cell that has rotated text but you cannot rotate text within a cell.

  • Can we put additional Crystal report in menu with rights?  Is it inbuilt ?

    dear all
    one of my clients want crystal reports in menu with user rights. is it possible. if yes how.
    regards
    sri

    Hi Sri......
    It is possible if you have SAP 8.8 and above version.
    Once you designed Crystal Report and Import it to certain menu then please go to Authorization and give it permission accordingly......
    Regards,
    Rahul

  • Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c

    Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c.  I need assistance on connecting these together so I can run a report.  I am not an IT person so if someone could dumb it down it would be great.
    Thanks,
    NBGHealth

    Hello,
    I assume GBS Agency Expert 6.7.6c is some sort of database or data source? If you have an ODBC driver then create or use a System DSN to the database. Then you can create a report using that DSN.
    Otherwise I suggest you contact the makers of GBS Agency Expert 6.7.6c and ask them how to connect to the database.
    Let them know CR is ANSII 92 ODBC 3 compliant.
    Thank you
    Don

Maybe you are looking for

  • The Wi-Fi on My iPod Touch 4G is Not Working (See Description)

    The Wi-Fi on my iPod Touch 4G is not working. People were working on my wi-fi, and, since it showed three bars still, I thought it was working. So when I found out it wasn't working, I tried to fix it by myself by forgetting the wi-fi network. Now, w

  • Media Manager in Windows 8???

    I just received a computer for the holidays with Windows 8. On my old PC was Media Manager, which I used to use to stream my music in the overnight so I didn't have to do much with my PC. I installed Media Manager on my new computer and it keeps shut

  • Xserve G4 Dual 1.3GHz PCI Options?

    I just picked up a Dual 1.3GHz G4 Xserve. I was wondering what my PCI options are. I was looking for what exact video cards work. So far I have only came up with the ATI8500 I believe. Is there any SATA cards that work to add external storage? Any in

  • Problems with BC4J - jdk version

    Why BC4J Tag Libs uses an old version of jdk (com.sun.java.util)and where can I find it? Thanks for your answers.

  • How do the two codes work ?

    i came across the following code in socket programming in the net,could anyone please tell me that how do the following codes work together? there is no main class in ChatHandler programme but there seems that it is a separate programme.. being new t