Which format Alinea sol report module use to store report fields in sugarcrm? - sugarcrm

we use alinea sol plugin to generate report in our sugarcrm. In database, asol_reports table in report_fields column, alinea sol store report fields definition in base64 encoded text. So, I decoded that, i get this result
"a:2:{s:6:"tables";a:1:{i:0;a:2:{s:4:"data";a:3:{i:0;a:17:{s:5:"field";s:10:"account_id";s:5:"alias";s:12:"Account Name";s:14:"fieldReference";s:10:"account_id";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:7:"Grouped";s:13:"groupingOrder";s:0:"";s:4:"type";s:6:"relate";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"0_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}i:1;a:17:{s:5:"field";s:11:"case_number";s:5:"alias";s:6:"Number";s:14:"fieldReference";s:11:"case_number";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:1:"0";s:13:"groupingOrder";s:0:"";s:4:"type";s:3:"int";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"1_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}i:2;a:17:{s:5:"field";s:11:"description";s:5:"alias";s:11:"Description";s:14:"fieldReference";s:11:"description";s:7:"visible";s:3:"yes";s:13:"sortDirection";s:1:"0";s:9:"sortOrder";s:0:"";s:8:"function";s:1:"0";s:3:"sql";s:0:"";s:6:"format";a:1:{s:4:"type";s:0:"";}s:8:"grouping";s:1:"0";s:13:"groupingOrder";s:0:"";s:4:"type";s:4:"text";s:3:"key";s:0:"";s:9:"isRelated";b:0;s:5:"index";s:3:"2_1";s:12:"enumOperator";s:0:"";s:13:"enumReference";s:0:"";}}s:6:"config";a:10:{s:7:"visible";b:1;s:10:"multiQuery";b:0;s:12:"deletedUsage";b:0;s:15:"paginationUsage";b:0;s:17:"paginationEntries";s:0:"";s:6:"titles";a:1:{s:7:"visible";b:1;}s:7:"headers";a:1:{s:7:"visible";b:1;}s:9:"subtotals";a:1:{s:7:"visible";b:1;}s:6:"totals";a:1:{s:7:"visible";b:1;}s:10:"pagination";a:1:{s:7:"visible";s:3:"all";}}}}s:7:"version";s:5:"5.0.2";}"
At first, I thought that this is in JSON. But later, I got that it is not in JSON. So, kindly help me to know in which format asol stores fields definition in asol_reports table. Also, if possible, kindly guide me to read this so programmatically I can fetch field names from this result. Thank you in advance

Related

How to create table using json in birt

i am having one column data as JSON format in table. i want to pass that column as report parameter in BIRT. can anyone help me how to parse JSON data and use it in the report.
One way to access the data sent through report parameter is creating a POJO (Plain Old Java Objects) Data Source.
You should create 3 java classes and convert it to jar file and use that as input for POJO Data Source.
Make sure that column names in json file match with the properties you create in java class.
You can refer this video for more info:
"https://www.youtube.com/watch?v=3ZD8wog2pmk"
Please let us know if you get other ways to achieve the same.

Insert URL into BIRT Report that contains dynamic parameters

I am fairly new to BIRT and I am working on adding some new functionality to one of our existing reports.
We have an application that makes a call to BIRT to generate the report in question. When this report is generated I would like to include a URL at the bottom of the report.
The only issue is that the URL would contain two parameters that are different for each report that gets generated. I created a data source and a data set that I can pull the parameters from, but I am not sure how to create a URL with the parameters that relate to the particular report that is being generated.
I have read that you can create a label and insert a hyperlink, but this doesn't seem to be of much help in my situation.
The URL that gets inserted into the report would need to look as follows:
localhost:8080/Application?key=firstParameter&securityString=secondParameter
Please let me know if I did not explain my situation thoroughly or if you need more clarification.
Best Regards,
-Dave
There are multiple ways to do this.
For example insert a new "Data" element to the report, set the datatype to "String" and enter as expression the text you want to display, i.e. "My URL" (with quotes because it is an expression).
Then click on "Binding" tab of this data element and select your dataset. Answer no to the question "Do you want to clear existing binding". In the popup, select all columns required to build the URL.
Finally use hyperlink property of the data element. May be you missed it can be an expression:
This pops up an expression builder, in your case this would result in something like:
"localhost:8080/Application?key="+row["firstParameter"]+"&securityString="+row["secondParameter"]

Using Select query, nothing merges onto Crystal report

I have a Crystal template that I am modifying in developer because we are changing the datasource from an Access file to our Oracle DB. I created a database field that accurately connects to Oracle and added a select statement that because pulls a field from a particular table
select s.field from table s;
On the right hand side, under database fields, I see my command and can right click and browse the data, which right now returns two values.
I also made a formula field using an Azalea barcode function that calls the values (I think, this is where stuff is going wrong, I guess)
The formula field is
BarcodeC39ASCII({Command.field})
So this should take the data and format it into the barcode, except when I use print preview or print out the report, no data is merged.
I've tested this by creating a new formula field with just the Command.field, and still no data is merged. I imagine there is something really obvious that I am missing and would appreciate any input.
So unless I misunderstood your question, you are changing your datasource from Access DB to Oracle DB, correct? Assuming that the database structure remains the same then all you should need to do is go into Database -> Set Datasource Location and set the datasource location from the Access DB to the Oracle DB and your existing report should work as it did. You might have to map some fields, but that should be the extend of it. Is that what you are trying to do?
Chris

Create Formula Field that Lists All Tables In Crystal Report

I am looking for a way to create a formula field that will list out the table names of all tables that are being utilized as data sources in a Crystal Report.
I have not found any function that provides that capability in the application yet.
This would be used to put the list of tables as a supplemental for those users that do not have access to the report file but need to know what tables are used in the report.
It seemed better to do this as dynamically as possible - instead of having to provide a static list of current tables linked into the report.
Thanks.
Unfortunately, this type of functionality isn't present in Crystal Reports.
You might be able to use a UFL to solve the problem. General idea:
pass path of current report to UFL (the Filename function will give you this)
open the referenced report using the Crystal Reports SDK and examine the tables in DataDefintion class; the DatabaseFieldDefinition.UseCount will help determine if a field (and hence table) is referenced in the report
return the table names as a string array (note: CR only supports 1-dimensional arrays w/ a maximum of 1000 elements)
create a formula field to call the UFL's function; Join() the string array (formula fields can't return an array):
Join(GetRptTables(Filename), ",")
distribute the UFL with the .RPT
Another option, if you have BusinessObjects Enterprise and a spare $40K, is Metadata Manager; this will give you a holistic view of your organization's reporting deployment.

Crystal Report referring to xsd file

I am trying to create a crystal report, but I want the connection string that I have mentioned in the Web.Config file to be accessed. Also, I want to create an xsd file for my crystal report file to refer. Can someone please direct me to a tutorial or forum to solve my problem?
Thank you all for helping me out.
I am now able to display data in the crystal report file using the XSD file.
The xsd file has fields which are exactly the same name as mentioned in the select query that is bringing values from DB.
The following is the part of the xsd file that contains the field names in the xs:element tag.
The datatypes of these fields , also needs to be mentioned. The XSD file name can be kept as desired.
The name "Summary_Report_on_portal" and "Summary_Updt" does not correspond to any dataset name in code behind or query fields. It can be kept as per the user's wish.
This XSD file needs to be referred into the crystal report, using the Database Expert in the Field Explorer window. The "Summary_Updt" name is visible in the new connections , which can be added to the crystal report.
The fields mentioned in the xs:element field are visible for the user to drag and drop into the crystal report.
When the user mentions the data source to the crystal report(dataset), the fields in the dataset are matched with the XSD field values.
CODE:
objBL.Rpt.SetDataSource(objBL.ds_shipment_info.Tables[0]);
Hope this is detailed enough. Let me know if anyone wants more info
you can also programatically set the report data source if you need to - I can provide details if you require
between calling myReportDocument.Load("myreport.rpt") and myReportDocument.Refresh() (the latter of which actually gets the data from the database) it is possible to add a call to myReportDocument.SetDataSource(myDataSource) which takes an object of data source type, which you can create, with a call to its constructors, with the URL of the data source you wish to use, its username and password.
Hope this helps
a different way would be to call ReportDocument::SetDatabaseLogon (String * user, String * password, String * server, String * database); before Refresh(); if you don't want to reuse a connection. This has the benefit of being simple but means that you dont reuse data sources.