Printing Report via page fragment instead of .jspx

Hi, I am using Jasper reports for printing the report for each selected patient in a table in my software, When I call the printing method from a .jspx button it works, but when i do the same work in a page fragment than my report did not run. Anyone can help me Please? (Jdeveloper studio 11.1.2.0.0) and Ireport (4.0.1)

Code for page fragment:
<?xml version='1.0' encoding='UTF-8'?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:f="http://java.sun.com/jsf/core">
<af:outputText value="Print Report" id="ot1"/>
<af:commandButton text="print appointment" id="cb1" action="#{JasperBeanPrinting.runReportAction}"
partialSubmit="true"/>
<af:panelCollection id="pc1">
<f:facet name="menus"/>
<f:facet name="toolbar"/>
<f:facet name="statusbar"/>
<af:table value="#{bindings.Patients.collectionModel}" var="row" rows="#{bindings.Patients.rangeSize}"
emptyText="#{bindings.Patients.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.Patients.rangeSize}" rowBandingInterval="0"
filterModel="#{bindings.PatientsQuery.queryDescriptor}"
queryListener="#{bindings.PatientsQuery.processQuery}" filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.Patients.collectionModel.selectedRow}"
selectionListener="#{bindings.Patients.collectionModel.makeCurrent}" rowSelection="single" id="t1">
<af:column sortProperty="#{bindings.Patients.hints.PatientId.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.PatientId.label}" id="c1">
<af:outputText value="#{row.PatientId}" id="ot2">
<af:convertNumber groupingUsed="false" pattern="#{bindings.Patients.hints.PatientId.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Dob.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Dob.label}" id="c2">
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.Dob}" id="id1">
<af:convertDateTime pattern="#{bindings.Patients.hints.Dob.format}"/>
</af:inputDate>
</f:facet>
<af:outputText value="#{row.Dob}" id="ot3">
<af:convertDateTime pattern="#{bindings.Patients.hints.Dob.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.ContactNo.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.ContactNo.label}" id="c3">
<af:outputText value="#{row.ContactNo}" id="ot4"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Gender.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Gender.label}" id="c4">
<af:selectOneChoice value="#{row.bindings.Gender.inputValue}" label="#{row.bindings.Gender.label}"
required="#{bindings.Patients.hints.Gender.mandatory}"
shortDesc="#{bindings.Patients.hints.Gender.tooltip}" readOnly="true" id="soc1">
<f:selectItems value="#{row.bindings.Gender.items}" id="si1"/>
</af:selectOneChoice>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Address.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Address.label}" id="c5">
<af:outputText value="#{row.Address}" id="ot5"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.PatientName.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.PatientName.label}" id="c6">
<af:outputText value="#{row.PatientName}" id="ot6"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.DistrictName.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.DistrictName.label}" id="c7">
<af:outputText value="#{row.DistrictName}" id="ot7"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.ProvinceName.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.ProvinceName.label}" id="c8">
<af:outputText value="#{row.ProvinceName}" id="ot8"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Status.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Status.label}" id="c9">
<af:outputText value="#{row.Status}" id="ot9"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Unit.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Unit.label}" id="c10">
<af:outputText value="#{row.Unit}" id="ot10"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.Rank.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.Rank.label}" id="c11">
<af:outputText value="#{row.Rank}" id="ot11"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.IdCard.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.IdCard.label}" id="c12">
<af:outputText value="#{row.IdCard}" id="ot12"/>
</af:column>
<af:column sortProperty="#{bindings.Patients.hints.ArmyNo.name}" filterable="true" sortable="true"
headerText="#{bindings.Patients.hints.ArmyNo.label}" id="c13">
<af:outputText value="#{row.ArmyNo}" id="ot13"/>
</af:column>
</af:table>
</af:panelCollection>
</ui:composition>
Code of Printing Bean:
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.type.WhenNoDataTypeEnum;
import net.sf.jasperreports.engine.util.JRLoader;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.binding.BindingContainer;
import java.io.File;
import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.util.JRSaver;
import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;
import net.sf.jasperreports.view.JRViewer;
import net.sf.jasperreports.view.JasperDesignViewer;
public class JasperBeanPrinting
public JasperBeanPrinting()
public String runReportAction()
DCIteratorBinding empIter = (DCIteratorBinding) getBindings().get("PatientsIterator");
String empId = empIter.getCurrentRow().getAttribute("PatientId").toString();
Map m = new HashMap();
m.put("patientId", empId);// where employeeId is a jasper report parameter
try
runReport("report2.jasper", m);
catch (Exception e)
return null;
public BindingContainer getBindings()
return BindingContext.getCurrent().getCurrentBindingsEntry();
public Connection getDataSourceConnection(String dataSourceName)
throws Exception
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup(dataSourceName);
return ds.getConnection();
private Connection getConnection() throws Exception
return getDataSourceConnection("jdbc/pmrDS");// datasource name should be defined in weblogic
public ServletContext getContext()
return (ServletContext)getFacesContext().getExternalContext().getContext();
public HttpServletResponse getResponse()
return (HttpServletResponse)getFacesContext().getExternalContext().getResponse();
public static FacesContext getFacesContext()
return FacesContext.getCurrentInstance();
public void runReport(String repPath, java.util.Map param) throws Exception
Connection conn = null;
try
HttpServletResponse response = getResponse();
ServletOutputStream out = response.getOutputStream();
response.setHeader("Cache-Control", "max-age=0");
response.setContentType("application/pdf");
ServletContext context = getContext();
InputStream fs = context.getResourceAsStream("/reports/" + repPath);
JasperReport template = (JasperReport) JRLoader.loadObject(fs);
template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
conn = getConnection();
JasperPrint print = JasperFillManager.fillReport(template, param, conn);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JasperExportManager.exportReportToPdfStream(print, baos);
out.write(baos.toByteArray());
out.flush();
out.close();
FacesContext.getCurrentInstance().responseComplete();
catch (Exception jex)
jex.printStackTrace();
finally
close(conn);
public void close(Connection con)
if (con != null)
try
con.close();
catch (Exception e)
Edited by: 967034 on Apr 16, 2013 6:27 AM

Similar Messages

  • Print the report on page has width larger than height and not landscape mode

    Hi,
    I'm trying to print report on page (Width: 18cm, Height: 13cm) which the width larger than the height.
    The problem is windows keeps changing the page oreintation to landscape and when I change it back to portrait its changing the width to 13cm and height to 18cm.
    I'm using dot matrix printer to print the report, if i put Landscape , printer is printing the text in horizontal.
    Already i have tried to setup the custom for on printer, and used custom page size but it is changing to landscape.
    I need to print the report with out preview, direct print top printer, NO PDF....
    Thank you .....

    Hi Anil,
    After testing the issue in my environment, I can reproduce it. When I set (Width: 18cm, Height: 13cm) as the Report Page size, it would automatically convert Orientation from Portrait to Landscape. Because the Orientation displayed is dependent on the page
    width and page height of the report.
    But in my scenario, the Orientation option just change the Width and Height sizes, it couldn’t affect the text rotation. I guess this issue can be caused by the printer and printer driver, please try to update them. Reference:
    http://stackoverflow.com/questions/15244336/printing-in-landscape-or-portrait-automatically-rotates-text-ssrs?lq=1
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Error using a taskflow inside a page fragment

    Hi,
    I am using a taskflow with a region in a jspx and it works.
    But when I put the region in a page fragment, and then call the page fragment from the jspx I get the following error:
    <Sep 13, 2012 8:39:07 AM PDT> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <BEA-000000> <
    java.lang.IllegalStateException: The expression "#{bindings.processViewerTaskflow1.regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "r1") evaluated to null.
    This is typically due to an error in the configuration of the objects referenced by this expression.
    If it helps, the expression "#{bindings.processViewerTaskflow1}" evaluates to "null".
    If it helps, the expression "#{bindings}" evaluates to "null". Now using an empty RegionModel instead.
         at oracle.adf.view.rich.component.fragment.UIXRegion.getRegionModel(UIXRegion.java:441)
         at oracle.adf.view.rich.component.fragment.UIXRegion._beginInterruptibleRegion(UIXRegion.java:727)
         at oracle.adf.view.rich.component.fragment.UIXRegion.setupChildrenVisitingContext(UIXRegion.java:538)
         at org.apache.myfaces.trinidad.component.UIXComponent.setupChildrenEncodingContext(UIXComponent.java:1156)
    I did all the bindings using the jdeveloper.
    This is the jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document title="untitled6.jspx" id="d1">
    <af:form id="f1">
    <jsp:include page="/untitled3.jsff"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    And this is the untitled3.jsff file:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:region value="#{bindings.processViewerTaskflow1.regionModel}" id="r1"/>
    </jsp:root>
    What is wrong ?
    Thanks

    Hi Pablo
    Frank already mentioned clearly in his post. I just want to share some useful links. First start with the link, like What to use When. And see the section where it clearly says we cannot share the data between the parent and its child adf region having JSFF and vice versa. This is achieved using Parameters Map etc.
    What to use When - http://www.oracle.com/technetwork/testcontent/adfregioninteraction-155145.html
    Fixed - http://www.baigzeeshan.com/2010/04/creating-pages-with-regions-in-oracle.html
    Dynamic - http://www.baigzeeshan.com/2010/06/working-with-dynamic-regions-in-oracle.html
    Thanks
    Ravi Jegga

  • Soap API error for reports 5 pages or more

    Hi,
    I am using soap api to get reports from BI Publisher, I am able to print reports 5 pages, when i try to get reports with pages more than 5 pages getting this error.
    [Error] Execution (1: 1):
    ORA-06503: PL/SQL: Function returned without value
    ORA-06512: at "APEX_040100.WWV_FLOW_WEBSERVICES_API",line 129
    I am using the  following code snippet, Make request is throwing an error
    l_xml := APEX_WEB_SERVICE.make_request(
        p_url      =>v_rpt_wsdl,
        p_action   => v_rpt_action,
        p_envelope => l_envelope
    l_xml is an xmlType
    My Apex schema is : APEX_040100
    Oracle : 10g
    Apex version: Application Express 4.1.1.00.23
    Please help me folks
    Thanks
    Kris

    Bummer! Thought that was the golden ticket!
    Can you run that function successfully through Toad or SQL Developer for those reports? Does it return a value? It looks like it is telling you that APEX_WEB_SERVICE.MAKE_REQUEST call didn't return anything. You are just requesting xml at that point so there shouldn't (theoretically) be size issues unless maybe you are requesting the whole phone book.
    Jen

  • Why cant i print my e print report

    why cant i print my settings for eprint.im connected to a network.it will not register the printersemail address

    Hey dciciarelli!
    Sorry to hear you're having a problem! What kind of printer do you have and what error message are you getting? In the mean time, here are some general things you can try. Power cycle your printer by unplugging it for about 30 seconds and then plugging it back in. If that doesn't work, try manually printing the page. This can be done either by going to Setup->web services->Printer email address, or by going to the ePrint button on the touchscreen and selecting print report/information page.
    If you tell me the model of printer I can provide you with more detailed assistance.
    Hope this helps!
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How can I select pages to print from a Word document using the report generation 'print report' vi?

    I have researched the knowledge base and found:
    Printing A Range of Pages or Number of Copies of a Report Using the Report Generation Toolkit in LabVIEW.
    This seems to be from a previous version of LV. I am using LV2010. The instructions given do not match up with the current vi. The information did provide a tip and drilling down into  the vi I was able to insert the from/to page numbers at the printout invoke method, however this prevents the print function from working in that it can no longer find the default printer.
    The error message is:
    Error 1015 occurred at NI_ReportGenerationToolkit.lvlib:Word_Print.vi -> NI_Word.lvclassrint Report.vi ->
    error 1015 is: Printer is not responding. Check printer configuration.
    Any ideas how I can make the modification to print, for example, pages 24 through 29 out of a 32 page word document?
    Thanks,
    Chris

    Hello, take a look at this article. Unfortunately the Generate Report Get Data to Modify.vi was remove since RGT 1.1.3 release. That being said, we can try to find a workaround. See "Configuring a Printer Through the Windows Dialog in LabVIEW", open the GetPrinterSettings.vi, at the PrinterSettings property node you can select the from/to page. I hope this helps.
    Alejandro | Academic Program Engineer | National Instruments

  • Print number of pages with Report Generation toolkit

    I use the report generation toolkit and the Print Report.vi to print a table and some text extracted from a MS Access database. The result of this is a print out that takes up several pages.
    Now, on each page i want something like (Page x of y), and I do not want to buy more expensive NI packages for this simple thing. I know it should be possible since the Report Express vi can do it --- which for me is a useless vi.
    I do not consider it a nice solution to try and keep track of the number of pages myself by dividing the table into more tables and use the new page vi between each "page table". This I would not like to do since depending on paper size, font size, and length of text strings in each cell this will be virtually impossible.
    By moving into the Print Report.vi I've tried to see if I somehow can extract the info --- I've not found anything usefull but expect a workaround to possible.
    Any suggestions?
    Cheers,
    Martin

    Hi Skinny,
    There are some tokens you can use in the headers and footers of Standard Reports generated by the Report Generation VIs.  If you take a look at [LabVIEW]\examples\reports\TextReportExample.llb\Text Report Example.vi, you'll see that the right footer text of the report has the token <pagenofm>, which generates a footer of the form "1 of 10", to indicate page 1 out of 10 pages.  There's also another tag you can use, <page>, that just lists the page number itself without a total number of pages.  If you look at the help for the Set Report Header Text.vi or Set Report Footer Text.vi, you'll see a link in the help for all the different "tokens" you can use with the report header and footer.  Actually, now that I think about it, you can use these tokens anywhere in the report, including the body text.
    Good luck,
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How to avoid printing a blank page when there is 'no data' in the report.

    how to avoid printing a blank page when there is 'no data' in the report.

    try like this
    if@section:IND=1
    this template
    end ifsectionbreak
    if@section:IND=2
    this template
    end if

  • Print, Export and Page Navigation Buttons in the Report

    When I view a report through CR4E, the generated report has 3 buttons namely Print, Export and Page Navigation buttons. But when I click on either of the buttons I get a &#39;null pointer exception&#39;. This is a critical error as I am unable to navigate past the first page. Do I have to add code to these buttons? If not, why am I getting an error? Kindly solve my problem as soon as possible.

    <p>Looking at your code it appears that you are storing the ReportSource in session prior to passing in the ResultSet. This will create a problem when a postback is made on  the viewer page (which all of the viewer actions do). If you look at the sample code which is generated when you use the JSP Page Wizard you will notice that the ResultSet is passed to the ReportClientDocument object prior to it being stored in session. Then, when the page is called again this object is retrieved and the ReportSource is used by the viewer. You can quickly run the test using one of our sample reports to see what I am talking about. The code below was generated using the Consolidated Balance Sheet.rpt and did not experience any problems doing any of the viewer actions.</p><%@page import="com.businessobjects.samples.JRCHelperSample,<br />com.crystaldecisions.report.web.viewer.CrystalReportViewer,<br />com.crystaldecisions.reports.sdk.ReportClientDocument,<br />com.crystaldecisions.sdk.occa.report.application.OpenReportOptions,<br />com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase,<br />com.crystaldecisions.sdk.occa.report.reportsource.IReportSource,<br />java.sql.Connection,<br />java.sql.DriverManager,<br />java.sql.ResultSet,<br />java.sql.SQLException,<br />java.sql.Statement"%><%<br /><br /><br />    try {<br /><br />        String reportName = "Sample Reports/Consolidated Balance Sheet.rpt";<br />        ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);<br /><br />        if (clientDoc == null) {<br /><br />            clientDoc = new ReportClientDocument();<br />            <br />            // Open report<br />            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);<br /><br />  <br />            {<br />                // **** POPULATE MAIN REPORT ****<br />                {<br />                     // Connection Info for fetching the resultSet<br />                    String connectStr = "jdbc:derby:classpath:/Xtreme";<br />                    String driverName = "org.apache.derby.jdbc.EmbeddedDriver";<br />                    String userName = "dbuser";        // TODO: Fill in database user<br />                    String password = "dbpassword";    // TODO: Fill in valid password<br /><br />                    String query = "SELECT CUSTOMER_NAME FROM APP.CUSTOMER WHERE COUNTRY = &#39;Australia&#39;";<br /><br />                    <br />                    String tableAlias = "FINANCIALS";        // TODO: Change to correct table alias<br /><br />                     <br />                    JRCHelperSample.passResultSet(clientDoc, fetchResultSet(driverName, connectStr, userName, password, query),<br />                        tableAlias, "");<br />                }<br /><br /><br />            }<br />        <br />            // Store the report document in session<br />            session.setAttribute(reportName, clientDoc);<br /><br />        }<br /><br /><br />            {<br />                // Create the CrystalReportViewer object<br />                CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();<br /><br />                //    set the reportsource property of the viewer<br />                IReportSource reportSource = clientDoc.getReportSource();                <br />                crystalReportPageViewer.setReportSource(reportSource);<br /><br />                // set viewer attributes<br />                crystalReportPageViewer.setOwnPage(true);<br />                crystalReportPageViewer.setOwnForm(true);<br /><br />                // Process the report<br />                crystalReportPageViewer.processHttpRequest(request, response, application, null); <br /><br />            }<br />            <br /><br />    } catch (ReportSDKExceptionBase e) {<br />        out.println(e);<br />    } <br />    <br />%><%!<br />// Simple utility function for obtaining result sets that will be pushed into the report.  <br />// This is just standard querying of a Java result set and does NOT involve any <br />// Crystal JRC SDK functions. <br /><br />    private static ResultSet fetchResultSet(String driverName,<br />            String connectStr, String userName, String password, String query) throws SQLException, ClassNotFoundException {<br /><br />        //Load JDBC driver for the database that will be queried    <br />        Class.forName(driverName);<br /><br />        Connection connection = DriverManager.getConnection(connectStr, userName, password);<br />        Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);<br /><br />        //Execute query and return result sets<br />        return statement.executeQuery(query);<br /><br />}%><p>Try using the code generated from the wizard to see if it works for you as well. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>

  • Print Report on half page

    hello,
    I am using report builder 6i. I want print on half page but the printer LQ-300+ uses full page. i want to print two receipts from one pages.
    Thanks
    iftikhar

    Make sure your frames are set up to handle that kind of printing. Check to make sure that 2 repeating frames will fit into one page. There are properties on the repeating frames and regular frames that can affect this, like "Page Protect", "Page Break Before/After","Maximum Records per Page" or "Space Between Frames" (these are just some). You also might want to check the height and width of you section. You can increase the height until you see 2 show up, that tells you your repeating frame is too big for 2 records for your original height.

  • 6980 wont stop printing report pages

    Help-My 6980 Deskjet has recently started printing report pages after every print job.  It seems to go into quiet mode on its own, prints the job and then continues to print multiple report pages until I turn it off.  Of course I'm out of warranty so no help from support.

    Sorry using XP PRo with a wireless connection.  No troubles there.

  • How can you print a single page of a multipage report.

    I am using Office 2003 pro, the LabVIEW Report Gen Toolkit, LabVIEW 7.0, and Windows 2000. I have created a lengthy report with the first page being a summary. I would like the user to be able to select; print the entire report, or just the first page. Any ideas?

    There are two ways you could go about doing this. They both are somewhat straight forward.
    1) Calling a macro from LabVIEW in Word.
    You could create a macro that would let you just print the first page and call this from LabVIEW when the user so desires. There is an example of how to call a macro if you use the example finder. Goto
    Toolkits and Modules>>Report Generation for Microsoft Office>>Run Macro on Word Table
    2) You can actually modify the print VI that comes shipped with LabVIEW. For Microsoft Word it is called Work_Print.vi and it is located with in the exclsub.llb. This can be found at..
    ..\Program Files\National Instruments\LabVIEW 7.1\vi.lib\addons\_office\_exclsub.llb
    You can also find this by digging through the Print Report.vi
    Inside this VI you will see an Invoke node that has the fields To and From. If you specify the start and end page here, by connecting integer controls or constants, this will let you specify the pages to be printed out.
    NOTE: If you modify the Work_Print.vi you may want to save it outside of this library and locally to your application directory. Therefore make sure any report VI you are using within your app. now dynamically references this local version of Word_Print not the one in the report library.
    Please don't hesitate to let me know if you need more information or a more descriptive explanation.
    Have a great day!
    Allan S.
    National Instruments
    Applications Engineering

  • Unable To Print or Access Page Setup in Crystal Reports 2008

    I have Win 7 32 bit, and installed Crystal Reports 2008 last week (v12.0.0.683 from the Help window).
    Every time I open a report, and from the Preview tab clicking File -> Print, or File - > Page Setup, I immediately receive a Windows message that "Crystal Reports has stopped working".  After a few seconds, another Windows message displays "Crystal Reports has stopped working - a problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available".  Then Crystal completely closes.
    I downloaded sample reports from the BO website, and still receive the error, so I don't think it's the report.
    When I view the Event Log, I see the following:
    Faulting application name: crw32.exe, version: 12.0.0.683, time stamp: 0x47c8be9a
    Faulting module name: ntdll.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdadb
    Exception code: 0xc0000374
    Fault offset: 0x000c283b
    Faulting process id: 0x94
    Faulting application start time: 0x01cc1fc304e98ecd
    Faulting application path: C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crw32.exe
    Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
    Report Id: 3cfc99e6-8bb8-11e0-b8ef-00248122792c
    I have uninstalled and reinstalled CR 2008 multiple times and continue to receive the same error.  I tried updating to SP1 (Version 12.1.0.892 Incremental) but I receive the following error: "A BusinessObjects product at a lower patch level is detected.  The installation cannot continue.  Please update all installed products to the SP1 patch level, then restart this installation".
    Need to print my reports - any ideas?

    Sorry busy on Support cases and they take precedence over this community forum.
    Very interesting....
    In a test application I use I have this routine to get the local printers:
    private void frmMain_Load(object sender, System.EventArgs e)
         if (System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count > 0)
              foreach(String myPrinter in System.Drawing.Printing.PrinterSettings.InstalledPrinters )
                   cboCurrentPrinters.Items.Add(myPrinter);                         
              cboCurrentPrinters.SelectedIndex = 0;
         else
              rdoCurrent.Enabled = false;
              EnableDisableCurrentControls(false);
         //For printers exposed to System account as per MS Kbase
         //http://support.microsoft.com/default.aspx?scid=kb;en-us;184291
         //Look to HKEY_USERS\.Default\Software\Microsoft\Windows NT\CurrentVersion\Devices
         Microsoft.Win32.RegistryKey mySystemPrinters =
              Microsoft.Win32.Registry.Users.OpenSubKey(@".DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Devices");
         foreach (String defaultPrinters in mySystemPrinters.GetValueNames())
              cboDefaultPrinters.Items.Add(defaultPrinters);
         if (cboDefaultPrinters.Items.Count > 0)
              cboDefaultPrinters.SelectedIndex = 0;
         else
              rdoDefault.Enabled = false;
    Note the MS Kabse on where the printer registry is. Now the odd part is on one of my test development PC's it won't populate the Default User Printer list, only the Local User Printers. I take this same app to another PC and it works just fine. The register keys are there but for some reason on my Windows 7 64 bit it won't show them, the other strange part is I have full access to both keys. I have not been able to figure out why this happens...
    I'm thinking this may be related to your issue.... But I don't have a solution, very strange... I've even gone into regedit32 and set full permissions on the various keys and it still doesn't work...
    I have other VM-ware images if I need to get past that part for testing so I never drilled into why, I believe it has to be some Windows/Firewall/Anti-virus configuration or something our IT department pushed into my local Profile.... What that is I don't know unfortunately.
    I'll do some looking and testing. You may want to post this on Microsoft forums as well.... Ask about printer permissions.
    Thanks
    Don

  • Print Report of cash Memo OR Page settings for cutsheet papers

    hello and hi
    me have a report of cash memo page size 12 by 13.8 cm (5 by 4.8 inch) ,using printer dot matrix
    problem is that when me print a single page , printer not stop , its go to end of next page its mean printer print at portarit size page ,
    any body help me how me ll handel the printer
    any one has a build example pls send me at [email protected] or send me link
    regard
    mahr

    Hi,
    You need to modify the prt file that your character mode report is using.
    the name of the prt file is the value in DESFORMAT system property in your report.
    Br,
    Gouri Sankar

  • How do I print the total number of pages in report, like Page 1 of 5?

    Hi
    How do I print the total number of pages in report, like Page 1 of 5?
    thanks,
    kiran.M

    Hi,
    Check for the below code:
    *Declare a variable
    DATA L_PAGE_COUNT(5) TYPE C.
    *Copy this code to the end of program
    *Page count will be printed on each page here
    WRITE SY-PAGNO TO L_PAGE_COUNT LEFT-JUSTIFIED.
    DO SY-PAGNO TIMES.
    READ LINE 1 OF PAGE SY-INDEX.
    REPLACE '-----' WITH L_PAGE_COUNT INTO SY-LISEL.
    MODIFY CURRENT LINE.
    ENDDO.
    TOP-OF-PAGE.
    WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.
    You will find your solution in below thread with code:
    Total Pages in Basic List
    Rgds,
    Shakuntala

Maybe you are looking for

  • FXpansion VST-AU adaptor-Can't access plug-in settings

    FXpansion VST-AU adaptor How do I access my Logic plug-in settings in order to edit their names? When I look in the Plug-in settings folder I just see a file called eg Discord.vst, whereas for the audiounits there are folders inside which are the fil

  • Missing records while fetching data from Data mart

    Hi, I have some missing records in the ODS.The data is fetched from the other BW system. It is a delta load & all the loads are succesfull as of now.But still some records are missing. If i see in reconstruction tab, some requests are showing the Tra

  • Image previews do not appear when viewing RSS feed in Mail, why not?

    When I view the Cult of Mac RSS feeds on my old white Macbook I get the image previews displayed right away in Mail but on my 2010 MBP there is just a question mark where the image should be. Any idea how I can get the images to appear on my MBP? Whe

  • Macmini withh radeon graphics blinking problem via AV receiver

    I have problem with connect via HDMI port in AVreceiver Marantz SR6003. AVreceiver sync the signal but picture is not stable. Picture flashing about 1 sec period. (Picture, whitenoise, black ,Picture....) This problem is not on other devices like mon

  • Lost documents... Can i get them back?

    Hi Guys I am hoping someone can help me and all is not lost. I was using Illustrator CS5 on Windows, with a number of documents open when I had to leave  my office to deal with a screaming daughter. I was then a little distracted  before I managed to