Jump to content
Changes to the Jaspersoft community edition download ×

srang

Members
  • Posts

    64
  • Joined

  • Last visited

Community Answers

  1. srang's post in How to contribute? was marked as the answer   
    There is a svn repo for all the community code here at http://code.jaspersoft.com/svn/ the user and pass are anonsvn
  2. srang's post in Convert result set to list and use as parameter was marked as the answer   
    Thanks to a comment on this post I was able to figure it out. So what I ended up doing is creating a report level query to get my base result set of id's. These ids were stored as an integer field. Then I created a report level variable with a class of ArrayList (variables don't have nested classes for some reason). Then in the initial value expression I put 'new ArrayList()' and then calculation I put System. Finally for the actual variable expression I put $V{<myvarname>}.add($F{<myfieldname>}). Then in my table dataset I do the basic $X{IN, <subreportfieldname>, <newparamname>} then create a tabledataset level parameter with the name I just used in my query. And to top it all of I linked up the parameter and report variable in the table configuration. Hope This helps someone!!!
  3. srang's post in SSO Pre-auth with visualize was marked as the answer   
    So I sort of came up with a way to get this to work. Like I said in a comment, the root of the problem is that when authenticating with plain text credentials when the user has an active session, it just returns. Conversely, when doing the same with pre-auth token authentication, it just hangs. I can go over to the server home page and log the user out and then refresh the page but obviously that isn't a reasonable solution for a user. So what I did to get around it was added:
    $(window).bind('beforeunload', function() { visualize(function(v) { v.logout(); }); });[/code]This logs the user out between pages and makes it feasible (although not very efficient)
  4. srang's post in How to use csv metadata export was marked as the answer   
    I love it when I get to answer my own questions haha.
    Anyways, I figured out how to configure the server to use the JRCsvMetadataExporter. I basically followed the directions here, and edited the viewReportBeans.xml, using the csvexport configuration as an example but renaming things to csvmetadataexporter. Then I created a ReportCsvMetadataExporter using the ReportCsvExporter as a template, but where it used JRCsvExporter and JRCsvExporterParameter, I used the JRCsvMetadataExporter and JRCsvMetadataExporterParameter (these are the classes jasper wrote for us). And then I rebuilt the server and was able to export it fine.
    So my ReportCsvMetadataExporter export method looked like:
    public void export(RequestContext context, ExecutionContext executionContext, String reportUnitURI, Map baseParameters) throws JRException { JRCsvMetadataExporter exporter = new JRCsvMetadataExporter(getJasperReportsContext()); exporter.setParameters(baseParameters); CsvExportParametersBean exportParams = (CsvExportParametersBean)getExportParameters(context); if (exportParams.isOverrideReportHints()) { exporter.setParameter(JRExporterParameter.PARAMETERS_OVERRIDE_REPORT_HINTS, Boolean.TRUE); } exporter.setParameter(JRCsvMetadataExporterParameter.FIELD_DELIMITER, exportParams.getFieldDelimiter()); exporter.exportReport(); }[/code]my viewReportBeans.xml had:
    <bean id="reportCsvMetadataExporter" class="com.jaspersoft.jasperserver.war.action.ReportCsvMetadataExporter" parent="baseReportExporter"> <property name="exportParameters" ref="csvExportParameters"/> <property name="setResponseContentLength" value="true"/> </bean>... <bean id="csvMetadataExporterConfiguration" class="com.jaspersoft.jasperserver.war.action.ExporterConfigurationBean"> <property name="descriptionKey" value="jasper.report.view.hint.export.csv"/> <property name="iconSrc" value="/images/csv.gif"/> <property name="parameterDialogName" value="csvExportParams"/> <property name="exportParameters" ref="csvExportParameters"/> <property name="currentExporter" ref="reportCsvMetadataExporter"/> </bean>... <entry key="csv" value-ref="csvMetadataExporterConfiguration"/> [/code]This isn't perfect though as I only needed it to override the csv export and only in the web service and Jive UI. It doesn't cover scheduling or adhoc reports and doesn't necessarily play nice with those configurations either so YMMV, but hopefully this helps! and sorry it took me so long to update this
×
×
  • Create New...