Printing Query

Post Author: tsparg
CA Forum: JAVA
Hi allI downloaded this code from the business objects website, and then played around with it. Have got it to print, but could somebody tell me how i would export using similiar code?Am i on the right track, or do i need to do an about face?  import com.businessobjects.crystalreports.printer.bean.ReportPrinter;import com.crystaldecisions.reports.sdk.ReportClientDocument;import com.crystaldecisions.sdk.occa.report.document.PaperSize;import com.crystaldecisions.sdk.occa.report.document.PaperSource;import com.crystaldecisions.sdk.occa.report.document.PrintReportOptions;import com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase;import com.microsoft.sqlserver.jdbc.SQLServerConnection;import com.microsoft.sqlserver.jdbc.SQLServerResultSet;import java.sql.DriverManager;import java.sql.SQLException;import java.util.logging.Level;import java.util.logging.Logger;import javax.print.PrintService;import javax.print.PrintServiceLookup;/** * Applies to: XI Release 2. * Date Created: October 2005. * Description: This sample demonstrates how to print a report directly to a printer (server-side printing). *                 NOTE: If the report is based on a secured database the database login credentials *                 will need to be set before calling the export method below.  Also, if the report *                 has parameters, then values will need to be set for the report before export method can *                 be called or an error will be thrown.  See the ViewReportParameters or ViewReportLogon samples *                 for samples on how to set parameters and login credentials through the JRC SDK. * Author: CW. *///Crystal Java Reporting Component (JRC) imports.public class JRCPrintReport {    static final String REPORT_NAME = "JRCPrintReport.rpt";    public static void main(String&#91;&#93; args) {        if (args.length == 0) {            PrintService&#91;&#93; printers = PrintServiceLookup.lookupPrintServices(null, null);            System.out.println("Available printers : ");            for (int i = 0; i < printers.length; i++) {                System.out.println(printers&#91;i&#93;.getName());            }            System.out.println("end Available printers ");            System.exit(0);        }        try {                       //Open report.            ReportClientDocument reportClientDoc = new ReportClientDocument();            reportClientDoc.open(REPORT_NAME, 0);            //Create and set print options.            PrintReportOptions printOptions = new PrintReportOptions();            printOptions.setPrinterName(args&#91;1&#93;);            printOptions.setJobTitle("Sample Print Job from JRC.");            printOptions.setPaperSource(PaperSource.auto);            printOptions.setPaperSize(PaperSize.paperLetter);            printOptions.setNumberOfCopies(1);            printOptions.setCollated(false);            PrintReportOptions.PageRange printPageRange = new PrintReportOptions.PageRange(1, 1);            printOptions.addPrinterPageRange(printPageRange);            ReportPrinter repPrint;            repPrint = new ReportPrinter();            repPrint.setReportSource(reportClientDoc.getReportSource());            repPrint.print(printOptions);                       reportClientDoc.close();            System.out.println("Successfully sent report to the printer.");        } catch (ReportSDKExceptionBase ex) {            Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex);        }    }}   regardsTim

Post Author: tsparg
CA Forum: JAVA
should i be usingimport com.crystaldecisions.sdk.occa.report.application.ReportClientDocument instead of import com.crystaldecisions.reports.sdk.ReportClientDocument??

Similar Messages

  • ADF: How to print query and query parameters passed in the executeQueryForCollection methof of VO impl class.

    Hi,
    Kindly let me know how to print the query and the parameters passed to it? I tried with the params parameter in super.executeQueryForCollection(qc, params, noUserParams); but could not succeed.
    I need to log the query and the params passed to it. Kindly help.
    Thanks in advance,
    Kalpana.

    Here you go
    Coding With Passion: Oracle ADF - Debug view object query with parameters

  • Printing Query data to MsWord Template.

    Dear all,
    I have some requirement, I want to print my query data on MS word or Open Office template from java or oracle packages. Using oracle version Oracle Developer Suite 10g 10.1.2.0.2 and Oracle 10g R2.
    Is there any way?
    Best regards,

    You have different possibility...
    First.. you can have a template of open office stored in BLOB and then you can unzip the sxw file on the database with java stored procedure.. and
    you can modify the xml file inside the sxw file with your data from query..
    Second you can use FOP libraries from apache community to write the data in word file... or you can use OLE to do it..
    Thirs.. you can use Open Office as server listener and using UNO libraries you can doo everything with it..
    Just look at the oppen office api ... http://api.openoffice.org/
    Edited by: Peterv6i on Apr 23, 2009 10:34 AM
    Edited by: Peterv6i on Apr 23, 2009 10:35 AM

  • Delay in printing with HP laser printer query

    I use a I Mac as well as a Ipad and Mac Air.  My printer is a HP 1525nw laser printer.  My network is via a Time Capsule Router/back up.  When I print, there is a long delay before the printer starts.  The Imac printer app says it is printing, but it doesn't seem to be reaching the printer. My printer is connected to the Time capsule with a USB cable, but my computers are all connected via my Airport wireless.   When I check an hour or so later, the printing is usually finished.  Why the delay?  Any help from the Apple nation would be appreciated. 

    Hi there,
    This article should cover the missing colors you are experiencing. Give the steps located here a shot and let us know if it helps.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Form printing Query

    Hi all,
    I have a very small problem which i am sure can be sorted out by you all in no time.
    I have a selection screen where the user has to input Vendor Number ( In Range) and Company Code.When the user executes the report it opens a smartform containing vendor details.
    Now the user wants to print the complete range of vendors one by one.
    i.e when the form of one vendor ends , the form of second vendor should start and so on...
    I am succesfully able to do that just for one vendor but not for multiple vendors.
    How can i solve this?
    Help appreciated.

    Hi,
    Declare the LIFNR field as select-options on Selection screen.
    and in the code:
    Sort ITAB by LIFNR.
    loop at ITAB.
      at new lifnr.
         call function START_FORM.
       endat.
         call function WRITE_FORM.
      at end of lifrn.
        call function END_FORM.
       endat.
    endloop.
    write the respective coding in the corresponding forms.
    it will trigger the output of all the vendors.
    Reward if useful.
    Regards,
    Anji

  • Print query regarding saving file as PDF/X-3

    I have a magazine ready for print for a client that uses a printer to print it. I am wondering whether or not the PDF I send them of the magazine (from InDesign CS5) will have any issues if I use the PDF/X-3:2003 Standard. Compatability is set to Acrobat 4 (PDF 1.3) and the document will have all necessary bleed marks etc. The reason I am using this standard is to stop the PDF creation process from not showing certain transparencies used with InDesign tools. It's a only a few pages that have this issue, where when I send them for proofing the effects from ID glow etc don't show up unless I use the  PDF/X-3 standard which keeps them in. So I am just wondering if it is ok to send the whole document as this standard when it goes to print (will there be any other issues with it saved this way? If so I will probably have to save the pages in question seperately and them pull them on as PDF's to the ID file and then save normally. The print site is modern so I doubt they have old software but I don't know for sure.
    Thanks for your time.

    In terms of a “state-of-the-art” PDF standard for prepress, Adobe recommends PDF/X-4 for overall workflow and output reliability. It supports full ICC color management as well as live transparency. All major RIPs (and software updates for same) from the last half dozen years as well as Adobe Acrobat fully support PDF/X-4.
    That having been said, there must be a “meeting of the minds” between the content creator/provider and the print service provider. If the print service provider can't support the PDF/X standard you wish to provide, you have two real choices - conform with what they want (and hopefully not suffer from the consequences) or find another print service provider.
              - Dov

  • List box printing query

    Hi all!
    I have just started using Adobe Acrobat Pro 9, and am trying to use list boxes.
    The problem I'm having is this:
    Say I create a list of 20 options, allow mulitselect, and select 5 of them.
    Is there any way to set it up so that when you print, only the 5 selected are printed, instead of all 20??
    I have tried playing with the visable/hidden setting, but that seems to show/hide all of them, not selected ones.
    I have searched for an answer for this, to no avail. Sorry if I missed one.
    Thanks for your help!!
    Nacki

    Not really.
    What you can do, however, is either delete all the non-selected items just
    before the file is printed, or export the selected items to another field,
    like a text box.

  • Air Print Query

    how do I set up air print on a kodak officehero 6.1 printer that has wifi to print from my iphone? Been making calls to Kodak, Apple with no luck. Everyone seems to be unable to crack the case. Any suggestions.....

    Nothing I can find about that printer says that it supports Airprint, which is probably why you can't find anything on it. The only way to print to that printer will be to route it through your computer, assuming your computer or network has WiFi. If you'll tell us what OS your computer runs, we can point you to instructions on how to set it up.
    Regards.

  • Cheque (Check) Printing Query

    My client has a requirement to perform 'step and repeat' functionality when printing cheques.
    An audit requirement of any laser cheque solution is the ability to re-print the payee and amount details several times.  The printers we have examined (HPLJ 4200 and Troy 8150) allow this to be re-printed up to eight times, and to undertake this printing at different angles (this makes it almost impossible to 'scratch' away the ink and re-print). 
    Would this functionality be possible when printing cheques directly from SAP or would it require third party software?
    Many Thanks
    Mark Briggs

    Thanks Murali,
    But it is a payment method for a company code and not for a house bank. Hence I can give only one form for a given payment method for a company code.
    Now if I have more than one bank with preprinted stationery where do I maintain the next form for the specified house bank.
    With regards
    Dhirav Shah

  • Smartform print  query

    Hi gurus,
    I had modified the one existing smartform as reduce the size of the form with new page i reduce the all windows table widths form is activating successfully and exicuting the functional module it is exicuted but in print or in printprivew come to the error as formating error  and message is table logo does not fit into logo.
    this error is occuring in logo window.
    plea give me helpfull procedure.
    Regards,
    sri.

    Hi,
    Increase the resolution of the  logo until the  logo fits into  the window.
    Please close the request if it closed,
    Reward points

  • IMac with free printer query

    Couldn't find anywhere appropriate to post this.....
    Two years ago I purchased a new iMac direct from Apple (Ireland) which came with a free HP Photosmart C4680 printer/copier/scanner. At the time I already had a printer so the HP has stayed in its box until now. I opened up the box recently to find that the power cable was missing. Phoned Apple to be told that this was not a mistake and that all those printers were shipped without power cables and it was up to the customer to source one themselves, which they say is the reason they were able to give them away free!!! According to Apple it's a very common cable which should be easy to find. It is in fact an unusual 32V cable that can only be sourced from China at a fee of nearly 80 euro.
    I was so taken aback by this that I didn't really argue my case when they said that they weren't willing to do anything about it.
    Has anyone ever heard of this strange practice of it being up to the customer to find a power cable for a product as common as a printer?
    Does the two year gap mean that Apple are under no obligation to help even though the shipped product was missing a vital component?
    I really don't want to have to throw a brand new printer in the bin.
    Thanks.

    It sounds like the Apple rep was describing is a USB printer-to-computer cable, which many printer manufacturers stopped including years ago. A power supply/cord is somewhat fundamental to the printers operation.  Two years later is a bit of a stretch to expect Apple to honor what sounds like a packaging defect by HP.  Have you contacted HP about a replacement power supply?

  • Printing Query Results

    I need to know how to print out an output grid directly from SQL Developer . When I try and do this I only get the SQL logic, but not the output data in the grid.

    It is not a grid, but if you choose "Script Output" (F5) it will create a 'fixed width' file that you can print from the "Script Output" window. You can print directly or cut&paste into something like TextPad and modify it from there.

  • My Menu - Add a Query Print Layout to the Report Folder

    This is a newb question.  I can easily add a Query or form or most anything else to the Folders under My Menus ... But how can I add a specific Print Query Layout to the Reports folder un My Menu?
    I know it is simple but I can not find the steps in the documentation
    Thanks in advance!!! 
    Dana

    Kapil
    I tried that, but it adds the Query not the QPLD to the menu.
    I had figured that I could go the the QPLD memu and add the Report, but that adds the Query Print Layout Menu with all the reports.
    I feel like I am missing something very obvious here!!!
    Thanks for your quick response!!
    Dana

  • Canon printer not printing even though query says "printing"

    I am having problem setting up my printer (Canon MF4350d) with Mac.
    I installed the printer by using the disc provided with the printer. Everything went fine. When I try to "print" I see the printing query, and it even says x% is sent over and such. But… when in fact, nothing is actually being printed out at all.
    I looked at the following setting:
    Printer & Fax -> Option & Supplies -> under the tab "Driver" I have Generic PCL Laser Printer selected because my printer model is not on the list. I don't know if that might be the reason…
    My printer says Canon MF4320-4350
    I have Mac OS 10.6 Snow Leopard
    I looked up in the other thread (Click here: http://discussions.apple.com/thread.jspa?messageID=12440612#12440612)
    I don't see the UFR2 folder under Canon :/
    Please help.
    Thank you in advance.

    Lin365 wrote:
    I looked at the following setting:
    Printer & Fax -> Option & Supplies -> under the tab "Driver" I have Generic PCL Laser Printer selected because my printer model is not on the list. I don't know if that might be the reason…
    This will be the reason. The MF4350 does not support the PCL or Postscript printing languages. You need to use the proprietary Canon UFRII driver. Delete this print queue as it will not work.
    I looked up in the other thread (Click here: http://discussions.apple.com/thread.jspa?messageID=12440612#12440612)
    I don't see the UFR2 folder under Canon :/
    Then this would indicate that you have not installed the Canon UFRII driver. Rather than using the provided disc I suggest you download the UFRII driver from the [Canon web site|http://www.usa.canon.com/cusa/support/consumer/printersmultifunction/imageclass_series/imageclassmf4350d#DriversAndSoftware]. After you download and unpack the file you can run the installer which will create the UFR2 folder under the Canon folder.
    Once the UFR2 driver has been installed you can then select to add the printer, this time ensuring the Print Using menu shows the MF4350. Note that when you do select the printer you will get a prompt stating that the driver is not installed. Ignore that and open the Print Using menu and click 'Select printer software'. This will present a list of installed drivers and a search window. Type MF43 and you will see the MF4350 UFRII driver in the list. Select it and OK and then click Add to complete the new print queue creation. Now try printing - this should get a lot further than the previous Generic PCL.

  • How to get save result from EXECUTE from a dynamic SQL query in another table?

    Hi everyone, 
    I have this query:
    declare @query varchar(max) = ''
    declare @par varchar(10)
    SELECT @par = col1 FROM Set
    declare @region varchar(50)
    SELECT @region = Region FROM Customer
    declare @key int
    SELECT @key = CustomerKey FROM Customer
    SET @query = 'SELECT CustomerKey FROM Customer where ' + @par + ' = '+ @key+ ' '
    EXECUTE (@query)
    With this query I want get col1 from SET and compare it to the column Region from Customer. I would like to get the matching CustomerKey for it.
    After execution it says commands are executed successfully. But I want to save the result from @query in another table. I looked it up and most people say to use sp_executesql. I tried a few constructions as sampled and I would always get this error: 
    Msg 214, Level 16, State 2, Procedure sp_executesql, Line 12
    Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
    So the output should be a list of CustomerKeys in another table.
    How can I save the results from EXECUTE into a variable? Then I assume I can INSERT INTO - SELECT in another table. 
    Thanks

    CREATE TABLE Customer
    (CustomerKey INT , Name NVARCHAR(100));
    GO
    INSERT dbo.Customer
    VALUES ( 1, N'Sam' )
    GO
    DECLARE @query nvarchar(max) = ''
    declare @par varchar(10) = 'Name',
    @key varchar(10) = 'Sam'
    CREATE TABLE #temp ( CustomerKey INT );
    SET @query =
    insert #temp
    SELECT CustomerKey
    FROM Customer
    where ' + @par + ' = '''+ @key+ ''' '
    PRINT @query
    EXEC sp_executesql @query
    SELECT *
    FROM #temp
    DROP TABLE #temp;
    DROP TABLE dbo.Customer
    Cheers,
    Saeid Hasani
    Database Consultant
    Please feel free to contact me at [email protected] as well as on Twitter and Facebook.
    [My Writings on TechNet Wiki] [T-SQL Blog] [Curah!]
    [Twitter] [Facebook] [Email]

Maybe you are looking for

  • HP Envy 4500 connection issues

    Hi. My Envy 4500 all the sudden will not print, becuase a message on my mac printer icon reads, 'Printer not connected." It HAS been connected....I don't know what happened. The driver appears to be missing from my computer, too. The printer itself,

  • Slow system with btrfs

    Hi, I have reinstalled system and choose btrfs as system default filesystem. System is overally very slow, maybe this can be also caused by systemd(I had installed archlinux without systemd before), but dont think so. It takes about 30s to start any

  • How to use stylus with ipad2

    Just bought a stylus for taking notes but do not know how to use it with the ipad2? Some special apps required? Thanks!

  • SQLLoader issues of Oracle RAC with ASM

    One of our client wants to use Oracle RAC with ASM for our application, i just want to know if there would be any two-phased commit transactions and SQL*Loader issues in ASM. Database is Oracle 10g

  • Reservation with Extended classic scenario

    Hi ;o) I'm working at a costumer were we have extended classic scenario. We want to be able to make reservations in the backend if the item is on stock, and we have seen in a solution matrix from SAP that this should be possible. The configuration fo