Data input solution after changing data source dynamically in RAQ Report

Problem

Sometimes, users may change the data source of input report template through RAQ Report API dynamically. However, after releasing the input report template with tag, an error message “Can’t find data source!” usually appears when users are inputting data in the web page.

Analysis

Through API of RAQ Report, users can only change the name of the data source of report template dynamically, but not change the data source in updated attribute correspondingly. As a result, the data sources in input template and updated attribute are different. Then, when users are inputting data, the system can’t find correct data source, and an error message pops up.

Solution

After changing the data source of report template, users should change the data source of updated attribute correspondingly.

With RAQ Report, users only need to get the corresponding relations between input report attribute and updated attribute, and change the data source of updated attribute.

Example

ReportDefine rd = (ReportDefine)ReportUtils.read(raq);
INormalCell cell = rd.getCell(2, (short)1);
//Get input report attributes.
InputProperty ip = cell.getInputProperty();
ArrayList al = ip.getUpdateList();
UpdateProperty up = (UpdateProperty)al.get(0);
//Get corresponding relations between input report attribute and updated attribute.
Object relations = up.getRelation();
if(relations instanceof com.runqian.report4.usermodel.input.TableRelations){
TableRelations trs = (TableRelations)relations;
System.out.println(trs.getDataSourceName());
//Set the data source of updated attribute.
trs.setDataSourceName("northwind");
up.setRelation(trs);
ArrayList ups = new ArrayList(1);
ups.add(up);
ip.setUpdateList(ups);
cell.setInputProperty(ip);

Source: Knowledge Base of Java Reporting Tool
Related Articles:
Submit data to multi-dataset/multi-source with web-based reporting tool — RAQ Report;
Make drop-down calendar for web application with web reporting tool;
Design web report with graphical interface of reporting tool;
Wonderful solution for complex data input in web report ;
Useful Links:
Knowledge Base of Web Reporting Tool;
Reporting Insights from Raqman;
Live in Reporting;
Dynamic datasource selection for BIRT and e.Spreadsheets;

Achieve checking multiple selections and batch deletions in row input report with RAQ Report

Background

For users of report, efficiency is very important. However, sometimes users have to do some simple operation time and again.

For example, there are a lot of data on a web page when making a row input report. Users may want to delete the data of 28 rows. If they have to click the “Delete” button every time when they delete a row, the page will be refreshed 28 times. That’s very inefficiency.

Then, how to solve it?

Solution

RAQ Report is a pure Web-based Java reporting tool. As it is a professional Web reporting tool, RAQ Report can help users to achieve batch selection and deletion in a row input easily.

Operation

With RAQ Report, you only need 4 steps.

Step 1: Design the report as shown below:
Design the web input report in the Excel-like report IDE of RAQ Report.
Note: A2 is set as checkbox. Set “Off” 0 and “On” 1.

Step 2: In the jsp file, add batch deletion javascript as follows:

function deleteRows(){
var report = document.getElementById('report1′);
for(var i=report.rows.length-2;i>0;i-){
var row = report.rows[i];
if(!row.all.tags("input")[0].checked) continue;
var cell = row.cells[1];
report.currCell = cell;
_deleteRow(report);
}
}

Step 3: In the jsp file, add checkbox javascript as follows:

function selcheck() {
var objs = report1.getElementsByTagName("input");
for(var i=0; i<objs.length; i++) {
if(objs[i].type.toLowerCase() == "checkbox" )
objs[i].checked =event.srcElement.checked;
}
}

Step 4: In the jsp file, add operating button javascript as follows:

<table>
<tr>
<td style="background-color:">
<div noWrap style="font-family: Ming;font-size:13px;color:;">
Select all:<INPUT type="checkbox" onclick="selcheck()">
<span style="cursor:pointer" onclick="_insertRow( report1 )">Insert</span>
<span style="cursor:pointer" onclick="_appendRow( report1 )">Add</span>
<span style="cursor:pointer" onclick="deleteRows()">Delete</span>
<span style="cursor:pointer" onclick="_submitRowInput( report1 )">Submit</span>
</div>
</td>
</tr>
</table>

Graphic Illustration

Made row input report which allows checking multiple selections and batch deletions.

Source: Knowledge Base of RAQ Report
Related Articles:
Dynamically add or delete a row when inputting data;
Make drop-down box for multiple choices with reporting tool;
Dynamic Row & Automatic Computation for Input Report;
Wonderful data input with reporting tool;
Useful Links:
Knowledge Base of Java Reporting Tool;
Jackson’s Reporting Review;
BIRT Multi-Select Statements;
Reporting Insights from Raqman;

How to customize prompt confirm message box for web input report?

Background

For web input report, users often need input data at the client-side. Then, if a prompt message box will appear when users submit input data to confirm submit success, it will be very convenient.

Sometimes, users have to customize prompt message box according to real requirement. Then, how to achieve it?

Solution

RAQ Report is a professional Web-based reporting tool pays a lot of attention to users’ requirement. Therefore, users can solve all the common problems in web report easily with RAQ Report. Such as radio button for single choice or multiple choices, drop-down list, automation computation, automation sequential number, data validity check, and batch operations, etc.

For this problem, RAQ Report provides a wonderful solution. Therefore, you can easily customize prompt box with RAQ Report. As it is a pure Java reporting tool,you only need to write JavaScript Code in a JSP file.

For example, if users want to add “cancel” in the prompt message box, they just need to set “cancel” as the value of promptAfterSave.

The JavaScript Code is as follows:

   <input type="submit" name="Submit2" value="submit" onclick="firm()" />
   
function firm()
{
// Use the return value of prompt box(true or false)
if(confirm("NeedSave"))
{
//If true is selected, call _submitTable( report1 )
_submitTable( report1 );
return true;
}
else
{
//Or else cancel it;
//alert("If false is selected, false will be returned");
return false;
}
}
</script>

Graphic Illustration

The prompt confirm message box made with RAQ Report.

Source: Knowledge Base of RAQ Report
Related Articles:
Wonderful data input with reporting tool;
Are you seeking a user-friendly Java development tool?;
Submit data to multi-dataset/multi-source with web-based reporting tool — RAQ Report;
Display a specific page or specific pages in web report ;
Useful Links:
Knowledge Base of Java Reporting Tool;
Freezea’s Report Lesson;
Jackson’s Reporting Review;
Building a Custom Confirmation Dialog Box;

Implement validity check in input report with web reporting tool

Background

For web input report, users often need to input data at the client-side. Then, the function of validity check is very important. For example, it needs to check if the input data is number or the input type is right.

How to implement validity check?

Solution

As a professional Java reporting tool, RAQ Report always tries best to make users convenient. To implement validity check, RAQ Report provides two ways.

1. Setting input data type of cell. By this, validity check can be realized automatically if data type is set as data value or E-mail. With RAQ Report, users can set the input data type of cell easily in the General tab below:

Users can select a desired input data type of a cell easily.

2. Writing validity check expression for a cell. Input validity check expression, and realize validity check manually. For example, input the validity check expression “${C5}>=0 && ${C5}<=100″ into the cell to ensure that the data value is between 1 and 100. Users of RAQ Report can write validity check expression for a cell in the Validation tab below:

Users can write a validation check expression of a easily.

However, if the input value is null, how to prompt users to input data? You can write JavaScript code in JSP to solve this problem.The JavaScript code in JSP is as follows:

function check(){
var checkWord=document.getElementById('report1_A1');
for(var i=0;i<checkWord.value.length;i++){
if(checkWord.value.substring(i,i+1)<"0″||"9"<checkWord.value.substring(i,i+1)){
alert("Please input data");
checkWord.value="";
checkWord.focus();
return false;
}
}
}

Source: Knowledge Base of Java Reporting Tool
Related Articles:
Dropdown tree makes report’s data input faster;
Dynamically add or delete a row when inputting data;
Dynamic Row & Automatic Computation for Input Report;
Realize default value/sequential number with reporting tool ;
Useful Links:
Excel-like Web-based Reporting Software;
Live in Reporting;
Freezea’s Report Lesson;
Build customized reports and validation rules with RDA;

Wonderful solution for complex data input in web report

In the real application of web report business, data input may be very complex. According to this condition, it is very important to provide data validity check. When inputted data is found illegal, there should be a prompt message box to remind users.

For illegal data, users can have 3 choices:
1. Submit data without remaining check.
2. Modify data before submitting again.
3. Ignore current invadity check, and continue other check.

These requirements are common in web input report business, because sometimes data validity check is only used to warm users, but not to prevent users from submitting data. For example, users may need to submit data no matter what invalid data error comes out.

At the same time, these requirements are fussy and frustrated. Do users have to realize the function by programming?

No, with RAQ Report, users can realize this complex function easily.

RAQ Report is a professional Web-based reporting tool pays a lot of attention to users’ requirement. Therefore, users can solve all the common problems in web report easily with RAQ Report without writing program. Such as radio button for single choice or multiple choices, drop-down list, automation computation, automation sequential number, data validity check, and batch operations, etc.

Compared with open source control can be downloaded from Internet, RAQ Report has many advantages:

1. RAQ Report is a commercial product, so the quality and performance is better. While open source controls are only developed by programming enthusiast, so no one can guarantee its qualiti and performance.

2. The company RAQSOFT will maintain and updata RAQ Report. But for open source controls, it is impossible to ask the makers to modify for you. If you want to modify them by yourself, the workload may be huge.

3. RAQ Report is designed and developed congruously, so you can develop a application project with it. However, if you use many open source controls in a project, the application may be very unstable.

4. RAQ Report has a graphical design interface, and it can increase the efficiency of web data maintain and input greatly.

Source: Knowledge Base of Java Reporting Tool
Related Articles:
The Function of Data Inputting;
Dropdown tree makes report’s data input faster;
Dynamically add or delete a row when inputting data;
Dynamic Row & Automatic Computation for Input Report ;
Useful Links:
Knowledge Base of Java Reporting Tool;
Live in Reporting;
Jackson’s Reporting Review;
Input validation or output filtering, which is better?;

Make drop-down calendar for web application with web reporting tool

Background

A drop-down calendar will be very convenient for end users, it can increase efficiency greatly. The developers of client-side program all know this.

Programmer have 3 choices:

1. Develop a drop-down calendar by themselves.

It is a waste of time and energy. Like the tyre of a car broken, and you don’t mend it or buy a new one, but produce one yourself.

2. Download a free control from Internet. There are many disadvantages:
(1) Open source controls are only developed by programming enthusiast, so no one can guarantee its qualiti and performance.
(2) It is impossible to ask the makers to modify code for you. If you want to modify them by yourself, the workload may be huge.
(3) If you use many open source controls in a project, the application may be very unstable.

3. Buy a commercial web reporting development tool.

Solution

In fact, this is the best choice, and RAQ Report is a wonderful development tool which can solve all the problems easily.

RAQ Report is a professional Web-based reporting tool pays a lot of attention to users’ requirement. Therefore, users can solve all the common problems in web report easily with RAQ Report without writing program. Such as radio button for single choice or multiple choices, drop-down list, automation computation, automation sequential number, data validity check, and batch operations, etc.

Moreover, common functions have been encapsulated in RAQ Report, and users can use them without writing programs. Such as export Excel/Word file, printing, page break, image upload, etc.

Easy Operation

With RAQ Report, the only thing users need to do is setting Edit style. As shown below:

With RAQ Report, users only need to set the Edit style as Dropdown Calendar to make a drop-down calendar.

Graphic Illustration

A perfect drop-down caledar made with RAQ Report.

Source: Knowledge Base of Web Reporting Tool
Related Articles:
7 shortnesses of displayTag;
Comparison between RAQ Report and Crystal Report;
A few tricks working with Crystal Report Designer;
SQL Server Reporting Services (SSRS) Versus Browser Compatibility ;
Useful Links:
Excel-like Web-based Java Reporting Software;
Freezea’s Report Lesson;
Jackson’s Reporting Review;
SharePoint, ASP.NET and more;

Submit data to multi-dataset/multi-source with web-based reporting tool — RAQ Report

Background

When developing data input module based on web, users always have to provide a data submission solution. The complexity of the solution is determined by the complexity of the input web-page.

Some conditions in an increasingly complex order are showed below:
1. There is only one record on the web-page.
2. Records correspond to a table of a database.
3. Records correspond to many tables of a database.
4. Records correspond to many tables of different databases.

Difficulty

1. Keep the transactional database consistency, especially when there are several databases.

2. Convert data type. The type of submitted data from web page is unrecognized; as a result, it has to be converted to proper type in database in the background.

3. Update the mapping relationship between field and the input cell on web page, especially a record corresponds to several cells indifferent expansion regions, or a field corresponds to a expression composed by several cells.

Someone may say that all these difficulties can be solved by writing program. However, the program has no commonality, and the workload will be huge.

Solution

RAQ Report is a professional web-based reporting tool. For users’ convenience, RAQ Report provides an almost perfect data submission solution: Multiple Database/Dataset Input Report.

With the Multiple Datasource/Dataset Input Report solution of RAQ Report, users can relate different tables from different databases, and submit data to multiple tables/databases, and keep the transactional consistency of database easily.

Easy Operation

1. Design an input report.
2. Define the Update attribute of the report. As shown below:
Define Update attribute of the RAQ Report
3. Release the report.

Source: Knowledge Base of RAQ Report
Related Articles:
Six Quick Crystal Reports Design Tips; Evaluation-Time functions in Crystal Reports Formulas; Keep the matching between code and display value in reporting tool; Writing to a database from Report Studio;
Useful Links:
Knowledge Base of RAQ Report; Freezea’s Report Lesson; Java Products and software download; Vara Prasad S Manjula’s Blog; Jackson’s Reporting Review

Change data source dynamically while updating RAQ web input report

Background

In web-based input report, users sometimes need to change data source dynamically. For example, in a web report, inputted data often need to be saved to different databases according to end users’ different options.

Then, how to achieve it?

Solution

RAQ Report is a professional Web-based Java reporting tool, and it can help users to make report easily.

As a real Excel-like reporting tool, RAQ Report provides a wonderful solution to change data source dynamically while updating web report. With RAQ Report, users only need to call RAQ Report API. Then, data sources will be dynamically changed when it’s runing.

ReportDefine rd = (ReportDefine)ReportUtils.read(raq);
INormalCell cell = rd.getCell(2, (short)1);
InputProperty ip = cell.getInputProperty();
ArrayList al = ip.getUpdateList();
UpdateProperty up = (UpdateProperty)al.get(0);
// Get the corresponding relation
Object relations = up.getRelation();
if(relations instanceof com.runqian.report4.usermodel.input.TableRelations){
TableRelations trs = (TableRelations)relations;
System.out.println(trs.getDataSourceName());
trs.setDataSourceName(”northwind”);
up.setRelation(trs);
ArrayList ups = new ArrayList(1);
ups.add(up);
ip.setUpdateList(ups);
cell.setInputProperty(ip);

Source: Knowledge Base of RAQ Report
Related Articles:
The Function of Data Inputting; Using BIRT as View in Spring; Keep the matching between code and display value in reporting tool; Writing to a database from Report Studio;
Useful Links:
Knowledge Base of RAQ Report; Freezea’s Report Lesson; Why Will 2009 be a Great Year for Business Intelligence?; Vara Prasad S Manjula’s Blog; Jackson’s Reporting Review