Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Jasper Reports und MDX

Empfohlene Antworten

Veröffentlicht

Hallo Zusammen,

ich habe da ein Problem mit JasperReports und dem SQL-Server2005.

Folgender funktionierender Code ist gegeben.

Ich möchte gerne diesem Bericht ein neues MDX übergeben.

Im Moment ist das MDX noch fest im Bericht verdratet.

Wie kann ich dies machen?

Vielen Dank

Gruß Patrick

Map params=null;

JasperPrint jasperPrint = null;

JasperReport jasperReport = null ;

String url = "http://srvbn110:80/OLAP/msmdpump.dll" ;

String ds = "SRVBN110" ;

String cat = "GKVProdCube" ;

String username = "Administrator" ;

String password = "bgs914" ;

//String cube = "GKV Star Prod" ;

String strQuelle="Kassenporträt.jrxml";

String strZiel ="Portaet.pdf";

ServletContext context = (ServletContext) getExternalContext().getContext();

strQuelle = context.getRealPath("/Berichte/" + strQuelle);

strZiel = context.getRealPath("/Berichte/Reports/" + strZiel);

log("Report-Quelle (Pfad) Kassenporträt: " + strQuelle);

log("Report-Ziel (Pfad) Kassenporträt: " + strZiel);

params = new HashMap();

params.put(JRXmlaQueryExecuterFactory.PARAM_XMLA_URL, url);

params.put(JRXmlaQueryExecuterFactory.PARAM_XMLA_DS, ds );

params.put(JRXmlaQueryExecuterFactory.PARAM_XMLA_CAT, cat);

params.put(net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory.PARAMETER_XMLA_URL, url);

params.put(net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory.PARAMETER_XMLA_DATASOURCE, ds);

params.put(net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory.PARAMETER_XMLA_CATALOG, cat);

if (username != null && username.length() > 0)

{

String tmpPassword = password;

Authenticator.setDefault(new HTTPAuth( username,tmpPassword));

params.put(net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory.PARAMETER_XMLA_USER, username);

params.put(net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuterFactory.PARAMETER_XMLA_PASSWORD, tmpPassword);

}

net.sf.jasperreports.engine.util.JRProperties.setProperty("net.sf.jasperreports.query.executer.factory.xmla-mdx","net.sf.jasperreports.engine.query.JRXmlaQueryExecuterFactory");

try {

//Buttons ausblenden

cmdSpeichern.setVisible(false);

cmdNeu.setVisible(false);

jasperReport = JasperCompileManager.compileReport(strQuelle);

jasperPrint = JasperFillManager.fillReport(jasperReport, params );

JRExporter exporter = new JRPdfExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,strZiel);

exporter.exportReport();

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.