How to create printable report from a swing app.

Hi,
I have googled quite a bit and have searched the forum extensively but haven't found answers to my questions.
I have a small swing based application (that uses jtextfields, jbuttons, jlist, etc) that collects information from user
and stores in some variables; which are like strings, integers, hashmap, etc.
Now this information is to be formatted and is to be printed as a report.
Formatted as in, some part of the collected text is to be printed in certain font and other in different color and so on.
Also the report is to be printed on a paper leaving some space at left and at the top. That means margins need to be set.
And before all info is to be sent to printer I need to display this information in some report viewer (preview).
How can I format certain text and set margins? (Is there some Document kind of api which allows me to set margins, change font of certain text?)
How should I display this text / information as a print preview? (Should I use jeditorpane / jtextpane ?)
How should I send all the information to the printer? (What java api should be used for printing?)
The data entered by the user is not saved / persisted to any database. It's to be sent to the printer after submit button is pressed on the swing app.
Since there is no database I couldn't use jasper-reports.
Following are links to all threads (not useful) I found when I searched for swing / print / report in the forum :
http://forums.sun.com/thread.jspa?forumID=331&threadID=225351
http://forums.sun.com/thread.jspa?forumID=57&threadID=576758
http://forums.sun.com/thread.jspa?forumID=57&threadID=570629
http://forums.sun.com/thread.jspa?forumID=1&threadID=489905
http://forums.sun.com/thread.jspa?forumID=57&threadID=571093
http://forums.sun.com/thread.jspa?forumID=257&threadID=138450
http://forums.sun.com/thread.jspa?forumID=57&threadID=583150
http://forums.sun.com/thread.jspa?forumID=57&threadID=5399572
http://forums.sun.com/thread.jspa?forumID=57&threadID=579619
http://forums.sun.com/thread.jspa?forumID=57&threadID=593199
Help would be much appreciated.

alan_mehio wrote:
The simplest thing to do in your case is to load the file content into the JTextArea
then to create the header and the footer if there is any from java.text.MessageFormat
then you invoke the print method on the JTextArea instance object> Just let me know if you are face any furrher problem
Alan Mehio,
I have been able to set margins and get the printout just the way I want it (after some experiments / trial & error).
But the problem is, parameters to paper.setImageableArea() are hard coded as in the example code below :
        System.out.println("print?");
        PrinterJob printJob = PrinterJob.getPrinterJob();
        if (printJob.printDialog()) {
            PageFormat pf = printJob.defaultPage();
            Paper paper = pf.getPaper();
            paper.setSize(8.5 * 72, 11 * 72);
            System.out.println("paper width : " + paper.getWidth());// expecting 612
            System.out.println("paper height : " + paper.getHeight());// expecting 792
            System.out.println("ImageableHeight : " + paper.getImageableHeight());
            System.out.println("imageable width : " + paper.getImageableWidth());
            System.out.println("ImageableX : " + paper.getImageableX());
            System.out.println("Imageable y : " + paper.getImageableY());
            //paper.setImageableArea(108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
            paper.setImageableArea(222, 244, paper.getWidth() - 222, paper.getHeight() - 244);
            pf.setPaper(paper);
            printJob.setPrintable(jTextArea1.getPrintable(null, null), pf);
            try {
                printJob.print();
            } catch (Exception ex) {
                System.out.println("exception while printing...");
                ex.printStackTrace();
        }In my case the left margin should be 1.5 inches (38.1mm) and top margin should be 2 inches (50.8 mm)
Considering 72dpi printer for a A4 size page (8.5in X 11in), the parameters to paper.setImageableArea() should be
(108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
But the printout leaves only 1inch for top and left margins.
Here are o/p lines for method-call with above said params :
paper width : 612.0
paper height : 792.0
ImageableHeight : 648.0
imageable width : 468.0
ImageableX : 72.0
Imageable y : 72.0
When I pass the following values I get text printed with desired margins on the paper but the above printlns remain exactly the same!
paper.setImageableArea(222.4, 244, paper.getWidth() - 222.4, paper.getHeight() - 244);
Although I have been able to achieve what I wanted to without using 3rd party libraries,
I feel this hard coding of values isn't a good idea and leaves a doubt whether this will work on other systems with different printers.
My question is, how to get these numbers correct every time? Is there a formula for obtaining these numbers?
Also formatting of certain part of to-print text is something that is yet to be figured out.
Thanks.

Similar Messages

  • How to create a Report from WebDympro

    Hi All,
    I just want to know how I can create a report from WebDynpro? I need to pull data from R/3 using a RFC function module, but I don't know if it exists a software to create reports.
    Thanks in advance
    Alexis Ramirez

    Hi Rich,
    Even i had a similar kind of problem. I wanted to fetch data from BI through the XMLA Connector which are created in Query Designer and then i wanted to fetch these fields and rearrange them and put it in a report format by colouring certain fields. Can the same can be done in WebDynpro.

  • How to create APEX report from data in PLSQL table

    Hi, I have a procedure that is creating/inserting records into multidimensional pslql table. I want to create a report and graph based on the data stored in plsql table. Can someone please advice how to can I select this data in apex OR point me to any sample code?
    Thanks
    Aali

    Hi,
    try to google something about ORACLE TABLE CAST
    SELECT ot.yourcolumn
    FROM
       TABLE(CAST(yourplsqltablevariable AS userdefinedoracletype)) otE.g.
    http://it.toolbox.com/blogs/oracle-guide/using-a-plsql-table-in-sql-11013
    Regards,
    R.

  • How to create crystal reports from ecc abap program?

    Hi all,
    I am new to sap ecc to bo report!!
    I heard that abap program cannot be directly connected to crystal reports,
    So created a function module which is equivalent to the abap program!!
    And happened to connect the same in crystal !!
    Can anyone let me know how to proceed !!
    will be there any performance issue ?
    can anyone guide me how to do reporting from ecc function module to crystal reports directly?
    Thanks

    Hi Pooja,
    From what I know, not all ABAP programs can be accessed in Crystal Reports. The program should return rows and columns, otherwise, CR would not be able to report off it.
    I'm not sure if there are any performance issues if we follow your path. Do you experience any?
    And, do you need help in creating a report on the function module, I mean do you also have any design related queries?
    -Abhilash

  • How to create a report from multiple dynamic XMLs

    Hi,
    I'm trying to build a consolidated report that gets data from multiple XML files and each XML file is different. Although the presentation of the data will be similar, the contents of the XMLs will vary and the number of XMLs to merge will also vary.
    What I would like to understand is the following:
    * Is it possible to generate a report template based on dynamic columns where the column names, their format and number is different for each business object?
    * Is it required to generate an XML with the entire data or can the template read information from different XML files? and if so how it can be done. Please notice that the formatting of each XML may be different.
    * Is it possible to use the services to generate the reports directly? Something around these lines was mentioned in one of the sessions but it was also mentioned that it's still WIP.
    I've been using the standalone version and although I can get the desired result, I couldn't merge data from multiple XMLs.
    Is the new BIP version available, or an enterprise version that I can use?
    Thanks in advance,

    Hi Rich,
    Even i had a similar kind of problem. I wanted to fetch data from BI through the XMLA Connector which are created in Query Designer and then i wanted to fetch these fields and rearrange them and put it in a report format by colouring certain fields. Can the same can be done in WebDynpro.

  • How can I create a Report from a SWT-Application?

    Post Author: mkoch
    CA Forum: JAVA
    I'm a Developer and new to Crystal Reports and I have the job to create a Report from a SWT-Application.The report-files ( *.rpt) were created with Crystal Reports 10 or 11.> I'm not sure but I have access to a machine where Crystal Reports 10 Developer an Crystal Reports 11 Runtime are installed.Can anybody describe in detail how I can start the creation of a report from my Java-Application?> What libraries are needed, where can I get them and so on.I saw in the CR10-Setup that there is a Java-feature - but unfortunately this is not installed on my test-machine.--> Is it necessary to install this feature or can I get this files on businessobjects.com?Is it possible to start the report-creation from command-line?I saw a Java-example on the internet which uses Report.exe - but I haven't found this on my machine.I hope, that somebody can help me.GreetingsMarkus

    Inv. #
    Item
    Sale Price
    Lisa
    Oct Sold 12
    Oct Sold 12-2
    Oct Sold 12-3
    149
    Vase Lidded
    25
    201
    Bird
    7
    7
    202
    Bird
    7
    203
    Bird
    7
    204
    Bird
    7
    7
    205
    Bird
    7
    7
    206
    Bird
    7
    7
    207
    Bird
    7
    207
    Bird
    7
    7
    208
    Bird
    7
    7
    209
    Bird
    7
    7
    This is my very simple inventory.  On previous program I could sort by those items that did not have any figure in the row across.  Then I could print a report of open inventory.  Such as 149 Lidded Vase has not sales amount in the four colums across, thus it is open inventory.  How can I capture all those items in one report?

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • How to create a report in EM from scratch level ?

    Hi,
    Can anybody help me on this ?
    The report I want to create in EM is about where the user selects a target from a drop down and it shows the CPU utilization or memory Utilization for that respective target. Is it possible to create such kind of ? If Yes, How to create the report ?
    Thanks in advance.

    Are you sure you want to create a report for this info?
    As CPU and MEM utilization changes every second, what would be the use of a report?
    I assume you are aware of the fact that CPU and MEM utilization is included for instance in the Host Homepage and can also be included in Group Pages and Dashboards.
    Regards
    Rob
    For more information on OEM GC, like Tips and Tricks please see: http://oemgc.wordpress.com

  • How to create a report based on a DataSet programatically

    I'm working on a CR 2008 Add-in.
    Usage of this add-in is: Let the user choose from a list of predefined datasets, and create a totally empty report with this dataset attached to is. So the user can create a report based on this dataset.
    I have a dataset in memory, and want to create a new report in cr2008.
    The new report is a blank report (with no connection information).
    If I set the ReportDocument.SetDataSource(Dataset dataSet) property, I get the error:
    The report has no tables.
    So I must programmatically define the table definition in my blank report.
    I found the following article: https://boc.sdn.sap.com/node/869, and came up with something like this:
    internal class NewReportWorker : Worker
          public NewReportWorker(string reportFileName)
             : base(reportFileName)
    public override void Process()
             DatabaseController databaseController = ClientDoc.DatabaseController;
             Table table = new Table();
             string tabelName = "Table140";
             table.Name = tabelName;
             table.Alias = tabelName;
             table.QualifiedName = tabelName;
             table.Description = tabelName;
             var fields = new Fields();
             var dbField = new DBField();
             var fieldName = "ID";
             dbField.Description = fieldName;
             dbField.HeadingText = fieldName;
             dbField.Name = fieldName;
             dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
             fields.Add(dbField);
             dbField = new DBField();
             fieldName = "IDLEGITIMATIEBEWIJS";
             dbField.Description = fieldName;
             dbField.HeadingText = fieldName;
             dbField.Name = fieldName;
             dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
             fields.Add(dbField);
             // More code for more tables to add.
             table.DataFields = fields;
             //CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo info =
             //   new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
             //info.Attributes.Add("Databse DLL", "xxx.dll");
             //table.ConnectionInfo = info;
             // Here an error occurs.
             databaseController.AddTable(table, null);
             ReportDoc.SetDataSource( [MyFilledDataSet] );
             //object path = @"d:\logfiles\";
             //ClientDoc.SaveAs("test.rpt", ref path, 0);
    The object ClientDoc referes to a ISCDReportClientDocument in a base class:
       internal abstract class Worker
          private ReportDocument _ReportDoc;
          private ISCDReportClientDocument _ClientDoc;
          private string _ReportFileName;
          public Worker(string reportFileName)
             _ReportFileName = reportFileName;
             _ReportDoc = new ReportDocument();
             // Load the report from file path passed by the designer.
             _ReportDoc.Load(reportFileName);
             // Create a RAS Document through In-Proc RAS through the RPTDoc.
             _ClientDoc = _ReportDoc.ReportClientDocument;
          public string ReportFileName
             get
                return _ReportFileName;
          public ReportDocument ReportDoc
             get
                return _ReportDoc;
          public ISCDReportClientDocument ClientDoc
             get
                return _ClientDoc;
    But I get an "Unspecified error" on the line databaseController.AddTable(table, null);
    What am i doing wrong? Or is there another way to create a new report based on a DataSet in C# code?

    Hi,
    Have a look at the snippet code below written for version 9 that you might accommodate to CR 2008, it demonstrates how to create a report based on a DataSet programmatically.
    //=========================================================================
    +           * the following two string values can be modified to reflect your system+
    +          ************************************************************************************************/+
    +          string mdb_path = "C:
    program files
    crystal decisions
    crystal reports 9
    samples
    en
    databases
    xtreme.mdb";    // path to xtreme.mdb file+
    +          string xsd_path = "C:
    Crystal
    rasnet
    ras9_csharp_win_datasetreport
    customer.xsd";  // path to customer schema file+
    +          // Dataset+
    +          OleDbConnection m_connection;                         // ado.net connection+
    +          OleDbDataAdapter m_adapter;                              // ado.net adapter+
    +          System.Data.DataSet m_dataset;                         // ado.net dataset+
    +          // CR variables+
    +          ReportClientDocument m_crReportDocument;          // report client document+
    +          Field m_crFieldCustomer;+
    +          Field m_crFieldCountry;+
    +          void CreateData()+
    +          {+
    +               // Create OLEDB connection+
    +               m_connection = new OleDbConnection();+
    +               m_connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdb_path;+
    +               // Create Data Adapter+
    +               m_adapter = new OleDbDataAdapter("select * from Customer where Country='Canada'", m_connection);+
    +               // create dataset and fill+
    +               m_dataset = new System.Data.DataSet();+
    +               m_adapter.Fill(m_dataset, "Customer");+
    +               // create a schema file+
    +               m_dataset.WriteXmlSchema(xsd_path);+
    +          }+
    +          // Adds a DataSource using dataset. Since this does not require intermediate schema file, this method+
    +          // will work in a distributed environment where you have IIS box on server A and RAS Server on server B.+
    +          void AddDataSourceUsingDataSet(+
    +               ReportClientDocument rcDoc,          // report client document+
    +               System.Data.DataSet data)          // dataset+
    +          {+
    +               // add a datasource+
    +               DataSetConverter.AddDataSource(rcDoc, data);+
    +          }+
    +          // Adds a DataSource using a physical schema file. This method require you to have schema file in RAS Server+
    +          // box (NOT ON SDK BOX). In distributed environment where you have IIS on server A and RAS on server B,+
    +          // and you execute CreateData above, schema file is created in IIS box, and this method will fail, because+
    +          // RAS server cannot see that schema file on its local machine. In such environment, you must use method+
    +          // above.+
    +          void AddDataSourceUsingSchemaFile(+
    +               ReportClientDocument rcDoc,          // report client document+
    +               string schema_file_name,          // xml schema file location+
    +               string table_name,                    // table to be added+
    +               System.Data.DataSet data)          // dataset+
    +          {+
    +               PropertyBag crLogonInfo;               // logon info+
    +               PropertyBag crAttributes;               // logon attributes+
    +               ConnectionInfo crConnectionInfo;     // connection info+
    +               CrystalDecisions.ReportAppServer.DataDefModel.Table crTable;+
    +               // database table+
    +               // create logon property+
    +               crLogonInfo = new PropertyBag();+
    +               crLogonInfo["XML File Path"] = schema_file_name;+
    +               // create logon attributes+
    +               crAttributes = new PropertyBag();+
    +               crAttributes["Database DLL"] = "crdb_adoplus.dll";+
    +               crAttributes["QE_DatabaseType"] = "ADO.NET (XML)";+
    +               crAttributes["QE_ServerDescription"] = "NewDataSet";+
    +               crAttributes["QE_SQLDB"] = true;+
    +               crAttributes["QE_LogonProperties"] = crLogonInfo;+
    +               // create connection info+
    +               crConnectionInfo = new ConnectionInfo();+
    +               crConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;+
    +               crConnectionInfo.Attributes = crAttributes;+
    +               // create a table+
    +               crTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();+
    +               crTable.ConnectionInfo = crConnectionInfo;+
    +               crTable.Name = table_name;+
    +               crTable.Alias = table_name;+
    +               // add a table+
    +               rcDoc.DatabaseController.AddTable(crTable, null);+
    +               // pass dataset+
    +               rcDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(data), table_name, table_name);+
    +          }+
    +          void CreateReport()+
    +          {+
    +               int iField;+
    +               // create ado.net dataset+
    +               CreateData();+
    +               // create report client document+
    +               m_crReportDocument = new ReportClientDocument();+
    +               m_crReportDocument.ReportAppServer = "127.0.0.1";+
    +               // new report document+
    +               m_crReportDocument.New();+
    +               // add a datasource using a schema file+
    +               // note that if you have distributed environment, you should use AddDataSourceUsingDataSet method instead.+
    +               // for more information, refer to comments on these methods.+
    +               AddDataSourceUsingSchemaFile(m_crReportDocument, xsd_path, "Customer", m_dataset);+
    +                              +
    +               // get Customer Name and Country fields+
    +               iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Customer Name", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
    +               m_crFieldCustomer = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
    +               iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Country", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
    +               m_crFieldCountry = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
    +               // add Customer Name and Country fields+
    +               m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCustomer);+
    +               m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCountry);+
    +               // view report+
    +               crystalReportViewer1.ReportSource = m_crReportDocument;+
    +          }+
    +          public Form1()+
    +          {+
    +               //+
    +               // Required for Windows Form Designer support+
    +               //+
    +               InitializeComponent();+
    +               // Create Report+
    +               CreateReport();+
    +               //+
    +               // TODO: Add any constructor code after InitializeComponent call+
    +               //+
    +          }+//=========================================================================

  • How to create a report of users in ucm about their roles and permission

    Hi All ,
    I need to create a report and it should contain all the users in ucm as well as their roles and permissions. Basically the report would be for the admin who can see all the users in a single report and can know about the roles and access of each and every users.
    How to create such report ?? I have tried from web layuot editor but the default report template i.e stdUserReport in user datasource does not contain more than three fields..Is there any method to get such kind of report???
    Please suggest!!

    There was an example component to demonstrate this kind of function. Under Stellent in version 7.5
    I do not know if they hand it out anymore but it is not on the standard samples page for Oracle. You may want to open a Support SR to ask for it. It should still be around in their servers if they can get permission to hand it out as a sample again.
    Sample CustomReports component to demonstrate how to create customized reports
    CustomReportsBundle.zip
    Date:     October 30, 2006
    Sample Version:     version=2006_10_20 (build 1)
    Product and Version:     Content Server
    Sample Status:     This is a Stellent Sample. Stellent Samples are free and include non-supported add-ons, utilities, tutorials or programming examples. It may require additional configuration or security auditing for maximum effect. It is not supported by Stellent without a consulting engagement.

  • How to create a report in Form line Style and can display Image field?

    Hi,
    In Report builder 10g, I would like to create a Report with Form Line Style and this report included a Image field.
    I can choose this Style only when Select Report type is Paper Layout. Because, If I choose Create both Web & Paper Layout or Create Web Layout only then in the next Style tab 03 option Form, Form letter and Mailing Label be Disabled.
    But in Paper Layout, my report can not display Image field.
    I tried with Web layout and all the other Styles (Except 03 mentioned be Disabled) then all Styles are displayed Imager field OK.
    How to create a report in Form line Style and can display Image field?
    I was change File Format property of my Image field from text to Image already in Property Inspector. But report only showed MM for my Image field.
    Thanks & regards,
    BACH
    Message was edited by:
    bachnp

    Here you go..Just follow these steps blindly and you are done.
    1) Create a year prompt with presentation variable as pv_year
    2) Create a report say Mid report with year column selected 3 times
    - Put a filter of pv_year presentation variable on first year column with a default value say @{pv_year}{2008}
    - Rename the second time column say YEAR+1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)+1
    - Rename the second time column say YEAR-1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)-1
    Now when you will run Mid Report, this will give you a records with value as 2008 2009 2007
    3) Create your main report with criteria as Year and Measure col
    - Change the fx for year column as CAST(TIME_DIM."YEAR" AS INT)
    - Now put a filter on year column with Filter based on results of another request and select these:
    Relationship = greater than or equal to any
    Saved Request = Browse Mid Report
    Use values in Column = YEAR-1
    - Again,put a filter on year column with Filter based on results of another request and select these:
    Relationship = less than or equal to any
    Saved Request = Browse Mid Report (incase it doesn't allow you to select then select any other request first and then select Mid Report)
    Use values in Column = YEAR+1
    This will select Year > = 2007 AND Year < = 2009. Hence the results will be for year 2007,2008,2009
    This will 100% work...
    http://i56.tinypic.com/wqosgw.jpg
    Cheers

  • How to create Crystal Report?

    Hi All,
    I'm a new beginner to the world of ODT. I have created a project using VB 2008 and Oracle 10g using Oracle Dev Tools for .NET version 11.xx. Now, I want to create simple report from my Oracle Database using Crystal Report. Can any one show me how to accomplish this? I try several methods but failed. Please guide me.
    Thanks in advance,
    Mr Haulai

    You can create a new crystal report.
    Then in Fied Exploer right-click on database fields and choose Database Expert. Database Expert Dialog box will appear expand create new connection expand on OLE DB (ADO) then OLE DB (ADO) Dialog will appear and then choose Microsoft OLE DB provider for Oracle in provider list box, click next then input your TNS, user name and password click next and finnish.
    You will go back database expert and then choose your username under TNS name, select your favorite table or view and turn it to Selected table list box ater that click ok.
    When you've already done everything above in Field Explorer you will see your table or view, click expand on your table or view -> drag a field and drop on report surface... then right click choose report preview to test it....
    Hope it can help you....
    Cheer
    Cambodia developer........ :-)

  • How to create custom report plugin using child region report metadata

    Hi,
    I want to ask for help on how to create custom report plugin using child region report metadata. My idea is to create a child region, a classic report and set the condition to never.
    Then i will query the child report metadata from apex view and use it to create a custom report like using jquery jq-grid. Any idea how i can create a process that will use the child report
    metadata? I dont know how i can create a process just like how apex work, how apex render report, coz i want it to be control using the standard apex report attribute. This plugin will
    render according to the child report attribute.
    Is there anybody here had ever done this?

    Hi Nicolette,
    Thanks for the reply. I know where to find the metadata, just asking for idea on how the rendering process will be.
    Start from determining column heading, column order until finish rendering the report. The same way how apex
    render the classic report.
    Previously this imy my rendering process:
    FUNCTION GETCOLUMN(P_REGION IN APEX_PLUGIN.T_REGION,
                         P_PLUGIN IN APEX_PLUGIN.T_PLUGIN,
                         P_VALUE  IN VARCHAR2) RETURN SYS.DBMS_SQL.DESC_TAB2 IS
        VSQLHANDLER     APEX_PLUGIN_UTIL.T_SQL_HANDLER;
        VCOLCOUNT       NUMBER;
        VCOLNAMES       VARCHAR2(2000);
        VAJAXIDENTIFIER VARCHAR2(100);
        VPAGESIZE       TYPEATTR := P_REGION.ATTRIBUTE_04;
        VJSCODE         VARCHAR2(32767);
      BEGIN
        VSQLHANDLER := APEX_PLUGIN_UTIL.GET_SQL_HANDLER(P_SQL_STATEMENT  => 'select * from s_emp',
                                                        P_MIN_COLUMNS    => 1,
                                                        P_MAX_COLUMNS    => 999,
                                                        P_COMPONENT_NAME => P_REGION.ID);
        VCOLCOUNT := VSQLHANDLER.COLUMN_LIST.COUNT();
        FOR I IN 1 .. VCOLCOUNT LOOP
          VCOLNAMES := VCOLNAMES || '{name: "' ||
                       UPPER(VSQLHANDLER.COLUMN_LIST(I).COL_NAME) || '",';
        END LOOP;
        APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
        RETURN VSQLHANDLER.COLUMN_LIST;
      EXCEPTION
        WHEN OTHERS THEN
          APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
          RAISE;
      END GETCOLUMN;
    So this is how i get the header for my report plugin. The same method is use to get the value / data for each column. This process is work. So now
    i want to extend my plugin so that i will use all attributes from the child report to render my plugin. So the column header, column order, all will depend
    on the child report. And the column display condition is set, it will also check the condition before render the column. Sounds like i want to reinvent
    the normal apex rendering process but this is what i want to achieve.
    I need help to find the correct logic for my render process. Don't want too much for starting, just want to render the plugin correctly, same with child report,
    same columns alias, column ordering and column  conditional display.
    Thanks,
    akulala

  • Creating a Report from Excel

    I'm trying to create a report from an Excel spreadsheet and am having some issues with how Crystal is reading in the data.  I have 7 fields that are all the same, I want them to be Numeric fields.  However, when I import the Excel sheet as the data source, 4/7 of the fields import as string fields into Crystal.  At first I didn't think this would be an issue, but some of the fields, and it doesn't seem to be consistently the "string" only or the "numeric" only fields, do not seem to be printing to the report at all - the space where they should be ends up blank.  I have gone back to the Excel sheet several times to change the cell format to Numeric, but that has not helped.  I also tried changing the format in Crystal, using ToNumeric(fieldname) or ToText(fieldname), and neither of those functions seem to work either.
    Has anyone had this issue before or know how to fix it?

    Hi Jeremy,
    Which Crystal Report version are you using?
    Have you applied any service pack for Crystal Reports?
    Which Operating system are you using?
    Is the issue is with all the report or single report?
    For testing purpose:
    -Create new excell sheet with two columns one is numeric and other one string.
    -Create report using thie excell sheet.
    -Preview report and export.
    -Now print report
    Are you getting same results?
    Have you tried to print other document through that printer is it working properly.
    Regards,
    Shweta

  • Creating a new connection when creating a report from scratch

    I've searched all around but I haven't managed to find any samples or forum posts that show how to create a connection when creating a report from scratch via RCAPI.  All of the code that I've found has been aimed at replacing the ConnectionInfo for an existing connection.  I figured that it would work something like this:
    m_crystalReport.setReportAppServer(ReportClientDocument.inprocConnectionString);
    m_crystalReport.newDocument();
    IConnectionInfo ci = new ConnectionInfo();
    PropertyBag propertyBag = new PropertyBag();
    propertyBag.put("Use JDBC", true);
    propertyBag.put("Connection URL", "jdbc:jtds:sqlserver://localhost:1433;databaseName=" + DB_NAME);
    propertyBag.put("Database Class Name", "net.sourceforge.jtds.jdbc.Driver");
    propertyBag.put("Database DLL", "crdb_jdbc.dll");
    ci.setAttributes(propertyBag);
    m_connection = new Connection();
    m_connection.setConnectionInfo(ci);
    m_connection.open();
    but this produces a NullPointerException within Connection.open().  If I leave the connection closed but add it to the report via DatabaseController.addConnection() then I just get the exception later on when I try to add tables using the connection.
    Can anyone give me any pointers please?
    Thanks,
    Rich.

    Just in case anyone else runs into this, I managed to fix it by leaving the connection closed and then using the connection info instead of the connection when creating tables, eg:
         ITable t = new Table();
         t.setAlias(v.getAlias());
         t.setName(v.getView().getName());
         t.setConnectionInfo(m_connectionInfo);
         getDatabaseController().addTable(t, null);

Maybe you are looking for

  • New Lacie Rugged Thunderbolt External Drive won't mount on Macbook Pro 8,1

    I've searched, and am coming up empty handed. Any help would be appreciated. So I own a late 2011 Macbook Pro 8,1. that's running version 10.9.5. I bought a brand new Lacie Rugged Thunderbolt External HD that won't mount via Thunderbolt, though it wo

  • Report on Devices Not Sending

    I am trying to think up a way of creating a report that would show devices that MARS hasnt received a log from in X days. I ran a report for all devices with the reporting devices ranked by session, and I noticed about 20 of my devices were not on th

  • 0FI_AP_4 - Delta Extraction Problem - Please help

    Hi,      I activated the business content ODS 0FIAP_O03 and the relevant infosource for Accounts Payable and also did the init. In R/3 I created an Invoice using FB60 transaction and Posted the payment using F-53 transaction. I can see the document i

  • Google agenda will not open. "This address will neve end"?

    I try to open my Google agenda. As a result I get an error message saying that this address will never end? I have no idea what happens.

  • Petstore Oracle Database Exception

    To whom it may concern, I recently installed WebLogic 7.0. It worked just fine with the pointbase database connection. The petstore example worked.. As soon as I began setting up weblogic with an Oracle database, I began running into problems. Here i