Telerik report in ASPX which accepts an array - asp.net-mvc-3

I have an MVC3 application and we are using Telerik Reporting. The Telerik report viewer must be hosted in an ASPX page named ReportPage.aspx. In its PageLoad method is logic to determine which report to display based on the querystring. I want to originate a request for a report from an MVC view and I would like the view to remain present, so I either need a popup or a new browser window for the display of the report. Once the user closes the report window, the original window should display intact.
I believe I can meet the above requirements, but here is the complication. I need to pass an large array of integers to ReportPage.aspx as an argument, so querystring won't work for me. As far as I know, I need to use a JSON object and a WebMethod to pass the array. But I don't see how the WebMethod (even if it is a method of ReportPage.aspx) can open ReportPage.aspx.
Does anyone see a way to make this work?

If your asp.net web site and your MVC web site have access to a shared database then:
Store dynamically the large array in the shared database and assign a unique report ID
Pass in the query string the report ID only.
In the aspx page load the report using the report ID
Run a sql job every night that deletes the previous day report IDs. No need to store them forever

Related

How to pass items between pages in Oracle APEX in client side?

I know when Oracle APEX page items are submitted to server (for example with ajax or saving data to database) it's possible to transfer them to another page, but I need to pass items between pages without submitting to the server. Is there any way?
You can use application item instead of page item. It is visible to all pages

Dynamics CRM - Custom development

I'm completely new to the Dynamics CRM environment.
Within our current implementation, there is a grid which displays a list of current sales opportunities. Within this grid, there is a column for the user which is a link to another part of Dynamics. We want to instead be able to open a new window to another system. How can I customize how that link gets rendered out so that the client "onclick" function can link to a javascript function which will open a new window with the URL we need?
Please see attached:
Snapshot of Dynamics grid
Im afraid that this is not possible with supported customization.
My understanding is that you will keep URL to external system on entity and you would like to be able to open with single click from grid displaying this record?
However, Im not sure if you add this fields as single line of text with format option URL won`t work as expected. If this does not work, you would need a custom grid to display this data.
You can store url in text field with format URL, click on such field will open link in new window/tab.

I need to introduce an intermediate page before I load the actual page for every request

I've a web application that uses FreeMarker templates and tiles to do the View job in the MVC world. So upon my request to the application, say /load.do I would like to introduce an intermediate page that will have a loader icon just to indicate the page is being loaded on the subsequent request, which is not known to the user.
So ultimately what I'm achieving is a better user experience and also if used within framework (the iFrames) this comes handy to show the loader icon when there is a new request that is happening.
Can someone point me to the right method I can use here ?
This is possible using spring mvc.
You need to create something like a WaitController. On user submit , this controller will be called. This can trigger your original request in background and take a reference(UUID) for the call and will render a wait page having the reference id of the original request set in model. Wait page can either trigger immediately the main controller using reference id or can poll the reference id on regular intervals or use web socket to know the availability of results. Once results are ready, it should redirect user to the actual result page.

What is the difference in purpose and functionality between iframes and AJAX?

I have a site that I want to load links in the centre column, so why would I use AJAX over an iframe?
AJAX is a system which allows you to get data - any data - from a server. This is in contrast to iframes which simply load in a HTML document or fragment based on a given URL.
THe strength of AJAX's flexibility over iframes is their ability to give you back raw data with which you then use to build or update your view. Consider this example: you have a dataset that needs to be displayed in tabular form, so you could set up a page that contains the table with your data in it and load that in via iframe.
A better option however, is to get the raw data from the server with AJAX and send it to your application uncluttered by markup and extra tags. Your page then builds the table in whatever part of the page it needs, according to how your application needs it to appear right at that point.
Where iframes can load HTML content that must be presented as it is built, AJAX allows the developer to separate the data from the way it is presented, giving them the freedom to manipulate it as much as they like and use it in as many ways, pages and applications as they need.
More Information
AJAX allows the client or web page to send data back to the server to do things with (such as changing passwords, updating settings, or transaction processing, etc.) so if your page or application needs two-way communication without refreshing the page, AJAX is probably the technology you'd use.
Also, using iframes restricts your ability to work with the data inside. An iframe creates a new context which you can think of as a container of sorts - the data inside is safe from the outside and vice versa. This often means your CSS won't flow down into your iframe giving you unexpected results. On some browsers, clicking a link in an iframe can actually cause the link's destination to load inside the iframe instead of changing the whole page - usually not what you want.

MVC 3. Load menu and content separately

I have an app with 3 sections:
Main menu;
Context Menu - Related to selected item in main menu;
and Page body - Related to selected item in context menu;
"Main menu" and "Context menu" are based on membership. I don't want to load them everytime my page loads, because that would consume resources database. So, I'm using ajax to load main menu only one time, and when an item is selected, I load the context menu for that item.
My problem is: Every form's post will erase my menu.
Question: Will I have to build my entire application using ajax? I don't wanna do that, because it is too much simpler do a post in the form then send all data to controller with ajax.
Until now, I have 2 options:
Load my menus with ajax and the page body with IFRAME, so the post's will not render again my menus.
Do everything using ajax;
Is there any alternative to load my menus with ajax and be able to use form's post?
Sorry if I wasn't clear enough.
The sentence that gave me a pause is this "I don't want to load them everytime my page loads, because that would consume resources database."
You see, I've build quite a lot of apps, that display menus and sub-menus based on user roles (what you called membership). This has never been an issue from the resources or database perspective.
You can access all the membership information that you need once, when your used is being logged in. In the simplest case user's identity will be stored in the context along with the roles they have (HttpContext.User), so you do not to need a database lookup at all to get this information on every request. Note that with this scenario no ajax is required either.
If for whatever reason you can't store your membership information in the context like this, you still can store in in session (if in-memory) or in encrypted Cookies.
Now, I understand, that I don't all the details of your scenario, and that may be in your scenario what you are trying to do is warranted, however I suggest you think it through again, as under normal circumstances what you indicate is a problem (database resource) should not be a problem at all.
The bottom line is: if you alter your application that it stores the membership information when user logs on you won't have your problem to start with.
You don’t have to build all of your application using Ajax. But in this scenario Ajax may be the best way forward.
Following is my suggestion
Create your data entry for inside a dev
Have each input controller marked with a class (say ‘dataEntry’)
Create a javascript function to iterate the dev and build a list of all elements that has class dataEntry
Build a json object using the list. Use the name of each element as property name and value as the property value
Use jquery ajax to post this to the controller action
[optional] you can use .done and .fail methods to take action on success or failures of the call
I know this may look intimidating, but if you have many data entry forms, you can re-use this code.

Resources