neeraja

Members
  • Content count

    6
  • Joined

  • Last visited

Everything posted by neeraja

  1. Hi Experts, I was trying to Export the rendered fusion chart reports to pdf but i am unable to do that i struck at configuring the export handlers. I am using FusionCharts_Evaluation for java and trying to configure following below steps.. 1. Copied FCExporter.jsp file in web root folder 2.Export jars fcexporter.jar and fcexporthandler.jar in WEB-INF/lib and fusioncharts_export.properties in WEB-INF/classes folder. 3.Added exportEnabled=''1'' exportHandler=''/FusionCharts/FCExporter.jsp'' exportAtClient=''0'' exportAction=''save'' exportFileName=''MyFileName'' exportShowMenuItem=''1'' to the rendering xml 4.verified the version of column3D.swf and pie3D.swf those were 3.1. I am able to render the chart successfully but i am not getting a progress bar saying capturing or nothing is happening that means i guess these handler classes are not called so nothing is happening please help me configuring i'm trying to configure this since 10 days. I am attaching the required files please have a look and please help me ASAP. Note: I am generating Column3D.xml dynamically using a procedure. Thanks in Advance, Neeraja Meka. ExporttoPdf.zip
  2. Hi Srividya, Thank you for the reply and i tried configuring like the sample application you provided in one of the posts but still am not able to see capturing box and also i guess no call is made to handler. I do have small question, Do i need to place any button and on clicking that button only the generated report will be captured after generating the report ?? (For server side saving) . Does it not save automatically when the report is rendered. I am attaching my project structure and the needed files please have a look and path issues if any please let me know. I am struggling with this since 15 - 20 days. I am also attaching the application i referred to configure Export. (name FusionChartsExportApp) Waiting forward for you reply !! Thanks in Advance, Neeraja Meka. Configuration.zip FusionChartsExportApp.zip
  3. Hello, I have problem configuring Fusion charts for exporting PDF/images into springs framework. My big doubt was i followed below steps to set up the environment which was specified in ReadMe which came with FusionCharts_Evaluation FusionCharts Server-side Export Handler - J2EE ============================================== For exporting the chart as image/pdf at server side using JSP, the following library files are required on your server: 1. fcexporter.jar (contains all the dependency classes) 2. fcexporthandler.jar (contains the export handler servlet and resources) 3. /classes/fusioncharts_export.properties (configuration file) Setup ----- Step1: Copy the neccessary files Please place the export jars fcexporter.jar and fcexporthandler.jar in WEB-INF/lib and fusioncharts_export.properties in WEB-INF/classes folder. FusionCharts Exporter has been tested with JDK 1.5. Note that the FusionCharts Exporter jars for jdk1.4.2 is also available in ExportHandlers/JDK1.4 folder Step2: Configure web.xml Add the following servlet mapping in your application's web.xml <servlet> <display-name>FCExporter</display-name> <servlet-name>FCExporter</servlet-name> <servlet-class>com.fusioncharts.exporter.servlet.FCExporter</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>FCExporter</servlet-name> <url-pattern>/JSP/ExportExample/FCExporter</url-pattern> </servlet-mapping> Please modify the url-pattern as per your application needs. Step3: Specify the xml attribute exportHandler='FCExporter' assuming that the jsp rendering the chart is present in /JSP/ExportExample folder. Step4: Configuration of save folder for server-side save -------------------------------------------------- This is to be done in fusioncharts_export.properties file. Make sure that the folder path that you specify has write permissions to it. I am facing problem while configuring <url-pattern>/JSP/ExportExample/FCExporter</url-pattern> As we are using Springs framework navigation to different pages were done via ModelView mapper that mean we use MVC . For generating the chart I use the following method public ModelViewMapper showBarchartReport(final HttpServletRequest request, final HttpServletResponse response) throws IOException {   LOGGER.info("ReportsHandler:showBarchartReport:Enter"); // added for dynamic levels int inputHid1 = Integer.parseInt(request.getParameter("InputHid")); String inputHid = inputHid1 + ""; inputHid = inputHid.trim(); String startDate = ""; String endDate = ""; String sztimestamp = ReportsHandler.getServerTime(); startDate = (String) request.getParameter("startDate"); endDate = (String) request.getParameter("endDate"); try { if (inputHid != null) { ChartReportsImpl fimpl = new ChartReportsImpl(); String strxml = fimpl.generateChartReport(startDate, endDate, inputHid); XmlElement xmlElement = null; xmlElement = XmlElement.createXmlElement(strxml); xmlElement.setAttribute("caption"," Application Name: "+szApplicationName+ " Report Created On:- "+sztimestamp); int count = xmlElement.getCountByXPath("//set"); int i = 0; for (int j = 1; j <= count; j++) { String value = null; value = xmlElement.getElementByXPath( "//set[" + j + "]").getAttribute("value"); if (value.equals("")) { i++; //LOGGER.info("Val---" + i); } } if (i == count) { //LOGGER.info("counting for null--"); request.setAttribute("count", NO_RECORDS_FOUND); return new ModelViewMapper(RETURN_FAILURE); } else { String path = (String) request.getRealPath("/"); FileWriter fw = new FileWriter( new File(path + "/modular/swf/data/Column3D.xml")); strxml = xmlElement.getXmlString(); //added by sandeep strxml = strxml.replace("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>", ""); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(strxml)); Document doc = db.parse(is); NodeList nodeList; Element element; String label; nodeList = doc.getElementsByTagName("set"); for(int j=0; j< nodeList.getLength() ; j++) { element = (Element)nodeList.item(j); label = element.getAttribute("label"); if(label.equalsIgnoreCase("RESPONSE RECEIVED")) { element.getParentNode().removeChild(element); } } Element root = doc.getDocumentElement(); root.normalize(); TransformerFactory transfac = TransformerFactory.newInstance(); Transformer trans = transfac.newTransformer(); StringWriter sw = new StringWriter(); StreamResult result = new StreamResult(sw); DOMSource source = new DOMSource(doc); trans.transform(source, result); strxml = sw.toString(); LOGGER.info("**************** Bar chart XML test : **************"+strxml); //end of sandeep code. fw.write(strxml); fw.flush(); fw.close(); String szUserId = (String)request.getParameter("userid"); InputStream inputStream = getClass().getResourceAsStream("/properties/config.properties"); Properties properties = new Properties(); properties.load(inputStream); String path_attachments = properties.getProperty("attachment_location"); String path_zip = properties.getProperty("attachment_location_zip"); //String path_zip1=path_zip.substring(23,58); if(szUserId.length() > 0){ getBarChartAttachments(strxml); ReportsImpl reportsimpl = new ReportsImpl(); reportsimpl.sendEmail(szUserId, path_zip); /*File attachments = new File(path_attachments); String[] children = attachments.list(); boolean status = false; for (int f=0; f<children.length; f++) { status = new File(attachments, children[f]).delete(); } status = attachments.delete(); if(status){ File zip = new File(path_zip); status = zip.delete(); }*/ } } } else { LOGGER.info(RETURN_FAILURE); } } catch (Exception e) { LOGGER.error(" Exception in showBarchartReport : " , e); } request.setAttribute("reportstatus", RETURN_SUCCESS); LOGGER.info("ReportsHandler:showBarchartReport:Exit"); return new ModelViewMapper(RETURN_SUCCESS); } which would be present in one of java handler and when it returns status either success/ failure it is directed to some jsp pages my big quest is for this url-pattern what would be the rendering jsp to be placed in url_pattern? as when i specify the jsp which actually renders the chart i'm not able to export the report instead it pops up the window which was attached and when i try to open it i get the following message displayed instead of chart statusMessage= Insufficient data. Width/height not provided.Background Color not specified. Taking White (FFFFFF) as default background color. statusCode=0 width=0 height=0 DOMId=null Please help me out with this ASAP. Thanks in advance, Neeraja.
  4. Sure, Please find the attached file. web.xml
  5. Hi Srividya, I basically have problem while configuring <servlet-mapping> as i am donot know what is the value to be substituted in <url-pattern> tag I mean to what jsp or servlet page i need to map this servlet (FCExporter) when defining it as a servlet in web.xml file. Thank you, Neeraja Meka.
  6. Hi Srividya, That was a quick reply and i appriciate it. Sorry couldnt respond back sooner. Yes, the chart was getting rendered and i am attaching the screenshot and the xml which was generated so that we can move forward. Waiting for your reply. Thanks, Neeraja Meka. Pie3D.xml