How to add Telerik Report Book into C# Report Libarary - telerik-reporting

I am using telerik report trial version and would like to club two report into a single report using Report Book feature but unfortunately not able to found option to add it in the C# Report Library.
I have created "Report Book" using telerik standalone designer tool but don't know how do i convert into C# Report library.
I would appreciate if you could give me some advice.

I advise you to use code behind from book report. You can access by pressing f7 from designer.
An example to club two reports using code behind:
public class ExampleBookReport : Telerik.Reporting.ReportBook
{
/* data source to your reports */
public ExampleBookReport (DataSourceModel dataSource)
{
/* adding report 1 */
var instanceReportSource = new InstanceReportSource() { ReportDocument = new ExampleReport1(dataSource) };
ReportSources.Add(instanceReportSource);
/* adding report 2 */
var instanceReportSource2 = new InstanceReportSource() { ReportDocument = new ExampleReport2(dataSource) };
ReportSources.Add(instanceReportSource2);
}
}

Related

How to use OOB report widget as embedded servicenow

For simple listing OOB (out of the box) widget, I can able to write code like this:
HTML:
<widget id="widget-simple-list" options="data.approvalsOption" ></widget>
Server script:
data.approvalsOption = {
"secondary_fields":"u_incident_title",
"always_show":"true",
"table":"incident",
"filter":"",
"display_field":"number",
"maximum_entries":"5"
};
In a similar way, I want to add an embedded report widget, I tried something like this:
HTML inside another widget:
<widget id="report" options="data.reportData" ></widget>
Server script:
data.reportData = {
"report_id":"45ytrhg43trgfgerewrfdads" //My report sys_id
};
I am able to achieve this with page designer and Edit->select_report (but I want as the embedded widget)
Try this:
HTML inside another widget:
<sp-widget widget="c.data.embeddedReport"></sp-widget>
Server Script
var reportOptions = {
report_id: "45ytrhg43trgfgerewrfdads", // Report sys_id
widget_parameters: '{"report_id":{"displayValue":"Report Title" }}'
};
data.embeddedReport = $sp.getWidget("report", reportOptions);

How to detect add or edit mode in HTML5 Lightswitch client?

How do you detect if, when using LightSwitch, the detail page is in Add or Edit mode?
I want to change the title of the screen from AddEdit Customer to either 'Add Customer' or 'Edit Customer'.
I can get screen.detail.dispayName = "Something". i need to know how to detect if it is in Add or Edit mode.
This is valid for HTML5 lightswitch -
There is Javascript namespace "msls" which encapsulates the LightSwitch JS framework to obtain the equivalent of EntityState.
The intellisense does not work so well, so if you keep getting screen.(nothing), add the following:
/// <reference path="../GeneratedArtifacts/viewModel.js" />
On the main event, add:
myapp.Customer.created = function (screen) {
if (screen.Customer.details.entityState == msls.EntityState.added) {
screen.details.displayName = "Add Customer";
} else {
screen.details.displayName = "Edit Customer";
}
}
where Customer is the dataset for the AddEdit HTML5 Lightscreen page.

Syncfusion WPF ReportWriter - How to set ReportParameters

I'm migrating a few reports from SSRS to Syncfusions's Reports. However, what I cannot seem to get to work is passing in parameters to the WPF ReportWriter.
I'm using this code:
ReportWriter reportWriter = new ReportWriter(reportPath);
List<ReportParameter> parms = new List<ReportParameter>();
parms.Add(new ReportParameter() { Name = "OrderId", Values = { "23456" }, Labels = { "test" } });
reportWriter.SetParameters(parms);
reportWriter.Save(#"c:\rdl\paul.pdf", WriterFormat.PDF);
It completely ignores the parameter, and does its own thing. None of the samples show this, and the documentation is basically non-existent. Perhaps someone else has experience of this?
Thanks,
Paul
This issue was resolved in syncfusion latest release version .
Thanks ,
Ragavan

Trigger a report from a ribbon button

I have several custom reports and I would like to be able to add buttons to the ribbon that trigger them.
Is it possible? And if so, any examples would be great !
Thanks in advance !
To run a report from a ribbon button you need to create a js file with a function you'll be calling from your button.
You need 4 things:
rdlName - rdl file name.
reportGuid GUID of the report.
entityGuid = Entity GUID wich you run report for.
entityType = Entity Object Type Code.
Here is the example.
function printOutOnClick() {
// This function generates a Print out
var rdlName = "SomeReport.rdl";
var reportGuid = "9A984A27-34E5-E011-B68F-005056AC478A";
var entityGuid = Xrm.Page.data.entity.getId();//Here I am getting Entity GUID it from it's form
var entityType = "4214";
var link = serverUrl + "/" + organizationName + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
openStdDlg(link, null, 800, 600, true, false, null);
}
openStdDlg() is the wrapper around window.open() MS Dynamics CRM uses it itself, so do I.
To add it to a ribbon button you need to do like in this post How to start a Dialog from Application Ribbon (CRM 2011) except you need to call report instead a dialog.
After the RDL name the Guid should be RecordGuid not EntityGuid

Griffon integration test or script that displays a griffon View

When I create plane java Swing components like dialog boxes etc, it is very easy to make a unit test to display the Dialog. Basically, I can just create an instance of the dialog and call setIsVisible(true). I'm having a really tough time figuring out how to do this with a griffon View. I've been trying to do this with integration tests but I can't seem to get it.
I've tried a few things to show the view and nothing seems to work. The only way I seem to be able to get an instance of the view is:
AirplaneView view = helper.newInstance(app, griffonpractice.AirplaneView.class, "Airplane")
After this I thought I may be able to do a view.setIsVisible(true) or view.frame.setIsVisible(true) but no luck. I'm guessing I am thinking about this the wrong way, there has to be a fairly simple way to do this. Any help is appreciated. My view looks like the following, note that there are no bindings so I shouldn't need to mock anything.
package griffonpractice
import javax.swing.JFrame
JFrame frame = application(title: 'GriffonPractice',
size: [320,480],
pack: true,
location: [50,50],
locationByPlatform:true){
borderLayout()
{
hbox(constraints: BL.NORTH)
{
label(text: "shane")
label(text: "Jack");
}
}
}
Have you tried using FEST? http://easytesting.org
The book Griffon in Action has a detailed example on testing a Griffon application using FEST, the source code is available at http://code.google.com/p/griffoninaction/source/browse/trunk/chap09/dictionary
Here's a short example of 3 tests for a simple application
package dictionary
import org.fest.swing.fixture.*
import griffon.fest.FestSwingTestCase
class DictionaryTests extends FestSwingTestCase {
void testInitialState() {
window.button('search').requireDisabled()
}
void testWordIsFound() {
window.with {
textBox('word').enterText('griffon')
button('search').click()
textBox('result')
.requireText('griffon: Grails inspired desktop application development platform.')
}
}
void testWordIsNotFound() {
window.with {
textBox('word').enterText('spock')
button('search').click()
textBox('result')
.requireText("spock: Word doesn't exist in dictionary")
}
}
protected void onTearDown() {
app.models.dictionary.with {
word = ""
result = ""
}
}
}