I am trying to export excel jasper report in RTL mode.It does not appear that my report properties are working correctly.
In this report I am using the below property to direct my excel sheet ti RTL.
net.sf.jasperreports.export.xlsx.sheet.direction=RTL
I tried another way too:
exporter = new JRXlsxExporter();
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(out));
SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
configuration.setSheetDirection(RunDirectionEnum.RTL);
exporter.setConfiguration(configuration);
None of the above solutions are working. Please,somebody help me out.
It seems the xlxs does not support the sheet RTL, you can use xlx as below:
exporter = new JRXlsExporter();
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(out));
SimpleXlsReportConfiguration xlsReportConfig = new SimpleXlsReportConfiguration();
xlsReportConfig.setSheetDirection(RunDirectionEnum.RTL);
exporter.setConfiguration(xlsReportConfig);
The issue has been raised at: http://community.jaspersoft.com/jasperreports-library/issues/6566
Related
I have following problem, i can not create a simple chart with PowerPoint:
Sub CreateChart()
Dim myChart As Chart
Dim gChartData As ChartData
Dim gWorkBook As Excel.Workbook
Dim gWorkSheet As Excel.Worksheet
' Create the chart and set a reference to the chart data.
Set myChart = ActivePresentation.Slides(1).Shapes.AddChart.Chart
Set gChartData = myChart.ChartData
' Set the Workbook and Worksheet references.
Set gWorkBook = gChartData.Workbook
Set gWorkSheet = gWorkBook.Worksheets(1)
In Line Set myChart = ActivePresentation.Slides(1) etc. following error:
Run-time error '429': ActiveX component can't create object.
in line Set gChartData = myChart. if i press CtrL + space, i don't see the paramather ChartData, just ChartArea.
Something is not working appropiately. The references that i have are:
Visual Basic For Applications
Microsoft Excel 14.0 Object Library
OLE Automation
Microsofot Office 14.0 Object Library
Microsoft PowerPoint 14.0 Object Library
Microsoft Feeds
Microsoft Forms 2.0 Object Library
The code was copied from the website from microsoft:
https://msdn.microsoft.com/en-us/library/office/ff973127%28v=office.14%29.aspx
How can it be possible that i use some code from microsoft and it doesn't work...? very frustrating.
Regards
I am developing windows application. In that, I using crystal report v13.0.2000.0. and used ExporttoDisk Method to create PDF file from Crystal report. and we are using TSScan for scanning purpose as scanner is in remote place.
When i try to Export the file on Disk using Crystal report DLL and then after i try to scan a new file, i got the error "Device is not open".
My code is as below. I found that the issue is generated only in case when the "ExportToDisk" line is executed. after executing this function I am not able to scan a new file. it gives error of "Device is not open".
Dim objReport As CrystalDecisions.CrystalReports.Engine.ReportClass
objReport = New ReportName
objReport.SetDataSource(DataSource)
objReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "FileName")
And after the calling this method scanner not recognized any devices. So i dont know why this happened. TSScan is working fine until we call crystal report export to disk method.
try this code:
objReport.ExportOptions.DestinationType = CRExportDestinationType.crEDTDiskFile;
objReport.ExportOptions.FormatType = CRExportFormatType.crEFTCrystalReport;
DiskFileDestinationOptions fileOption = new DiskFileDestinationOptions();
fileOption.DiskFileName = "Test.rpt";
objReport.ExportOptions.DiskFileName = fileOption.DiskFileName;
objReport.Export(false);
I am using jasperreport api-s to generate reports for my web application and i am converting the same in HTML , PDF , EXCEL and CSV formats .
I am creating it in the following way .
JasperReport jasperReport = null;
JRDesignQuery jq = new JRDesignQuery();
jq.setText("select * from employeetab"); //SQL Query might return 10-1000 or more records
jasperDesign.setQuery(jq);
jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jasperPrint = null;
jasperPrint = JasperFillManager.fillReport(jasperReport, null, dbconnection);
while executing JasperFillManager.fillReport(jasperReport, null, dbconnection) , but the server is taking too much time at times , and sometimes it does not even show up .
The issue is not very consistent .
The application is deployed in a Linux Server .
I have also tested in windows but i hardly face the above issue .
Any idea what might be the issue ??
If you are exporting to HTML, jasper can be very, very slow. This is because the HTML it is outputting is super verbose - if your report has 1000 lines in it, it could be several megabytes in size.
I have a .rpt file that I have created by setting it's data source as a text (csv) file using the (Access/Excel (DAO) ) option.
Now I want the same .rpt file loaded using a C# code and each time my C# code will change the input file and I want a new report to be generated based on the data in the new text file.
I am doing the following code and when I export the file to a pdf document, it still displays the data according to the data in the old input file.
I have checked off the option in the .rpt file that says "save data with report" and "verify on first refresh".
What am I missing here?
CODE:
cryRpt = new ReportDocument();
cryRpt.Load(reportfile);
Tables tables = cryRpt.Database.Tables;
TableLogOnInfo tableLogonInfo;
foreach (Table table in cryRpt.Database.Tables)
{
tableLogonInfo = table.LogOnInfo;
tableLogonInfo.TableName = "MYdata_BS_NEW#csv";
table.Location = "MYdata_BS_NEW#csv";
table.ApplyLogOnInfo(tableLogonInfo);
}
cryRpt.Refresh();
// After this I export the report to pdf document.
How to convert excel data into xml file using ado.net?
You can use the Microsoft Jet OLEDB 4.0 Data Provider to read the Excel file. Information about how to establish a connection to an Excel file can be found here.
This article explains how to read an Excel file using the provider. Once you have read the data, you can compose your XML document using LINQ to XML or the System.Xml classes.
In Excel, you can save the file to XML by using the File menu and changing the saved file type to XML spreadsheet.
If you want to read an Excel XML file with ADO.Net, try the XmlReader.
Or see this step-by-step example from Microsoft.
I've not used ado.net, but I've used xquery very successfully for this. Use excel export to create an XML file, then write xquery/xpath commands to convert as you want. Excel XML export format is pretty gnarly but it does do the job. Use the Oxygen 30 day eval license to lighten the xquery debug job.
use this code :
public static DataSet exceldata(string filelocation)
{
DataSet ds = new DataSet();
OleDbCommand excelCommand = new OleDbCommand();OleDbDataAdapter excelDataAdapter = new OleDbDataAdapter();
string excelConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + filelocation + "; Extended Properties =Excel 8.0;";
OleDbConnection excelConn = new OleDbConnection(excelConnStr);
excelConn.Open();
DataTable dtPatterns = new DataTable();excelCommand = new OleDbCommand("SELECT UUID, `PATTERN` as PATTERN, `PLAN` as PLAN FROM [PATTERNS$]", excelConn);
excelDataAdapter.SelectCommand = excelCommand;
excelDataAdapter.Fill(dtPatterns);
dtPatterns.TableName = "Patterns";
ds.Tables.Add(dtPatterns);
return ds;
}
and then convert returned datatable to xml with DataTable.WriteXml()