Multiple Datasets w/ Observers
I have a spry-ajax paging system setup so users can goto the
next 10 records, or back 10 records, etc.
it uses the onDataChanged observer to do
contentObserver.onDataChanged = function(dataSet, data){
Do some stuff
This works fine when there is one dataSet being used, but now
we need to add paging for multiple datasets, and we could have 5 or
6 on a page.
Normally, I would just do this:
contentObserver.onDataChanged = function(dataSet, data,
dataSetNumber){
But I'm new to observers, and my understanding is it doesn't
work that way. But there must be a way to know inside my function
what dataset is being returned.
So has anyone every done spry paging with multiple datasets
and could shed some light on this?
Try to create a general function like this:
myDataChanged = function(dataSet, data, datasetnumber){
Do some stuff
and then call this function from within different observers:
ds1.addObserver({onDataChanged:function(ds, data){return
myDataChanged(ds, data, 1)}});
ds2.addObserver({onDataChanged:function(ds, data){return
myDataChanged(ds, data, 2)}});
ds3.addObserver({onDataChanged:function(ds, data){return
myDataChanged(ds, data, 3)}});
If this doesn't help you, please describe us the real use
case when you need multiple pagination.
Thanks,
Diana
Similar Messages
-
Creating a Month dropdown list for a report with multiple datasets
I am currently working on a report that contains many charts that rely on multiple datasets. Currently, I have parameters @StartDate and @EndDate to display the information of the previous month across all the charts as my default value. Now, I would like
to create a dropdown list so that the user can pick any month, and have the report display the data across all the charts for that particular month, while keeping the display of the previous month as the default value. Can anyone help as to how I can approach
this. Would I have to use an expression when I specify my available values, or would I have to create a dataset to get the value of all 12 months? Any help would be greatly appreciated.This is essentially where I am having some trouble, as in creating the dataset that returns the individual months of the year as I am relatively to the use of SSRS. Could you possibly elaborate on how I can do so? Thank you in advance!
Create a dataset in SSRS
Inside dataset properties map datasource and then inside give command like
DECLARE @Month int = 5 --example value
SELECT ...
FROM Table
WHERE datefield >= DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-2),0)
AND datefield < DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-1),0)
then on refresh it will take field information and parameter information by itself.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Lookup or Filter multiple datasets in an Expression?
Hi
I am new to Visual Studio and am trying to find my feet.
I have a totals form which I can use an Expression to select all the data from multiple datasets fine, but I am wanting to filter the results to just show a single user at a time on my form. (Dataset shows Users and Grand Totals)
Is it possible to use an Expression to say (Select ["Grand Totals" from Dataset1] where ["User" from Dataset1] = "Julie Smith") ?
Thank you
TraceyHello Tracey,
Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
In addition, If you are working with Windows Forms app, you can consult on Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
If you are working with WPF app, you can choose WPF forum:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf
If you are working with ASP.NET Web Application, I suggest that you can consult your issue on ASP.NET forum:
http://forums.asp.net/
for better solution and support.
Visual Studio Language Forums:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hi all,
What is meant by multiple datasets???
regards,
PavaniWhy dont you do a google on the same?
Regards,
Jai Shankar -
No content with multiple datasets in detailregion
I have a detailregion, in which I don't just want to display
data, but want to enable data maintenance via a form. There are
some dynamic select fields, so their datasets are declared together
with the main dataset when the detail region is set up. T
The code used to declare the detailregion is
<div spry:detailregion="routerlist_xml edit_country_xml
edit_region_xml">
The detailregion that should be under the list display is
well - not showing.
When I take the datasets for the select fields away so the
line looks like
<div spry:detailregion="routerlist_xml">
the detailregion displays as expected.
(Of course the browser will complain about the missing
datasets, but that is not the point here).
Is it not possible to have multiple datasets in a
detailregion? If not, what is a workaraound to get a dynamic select
into a detailed field? If yes, is there anything wrong in my code?
Or is there a bug in the Spry framework?
Any pointers are welcome.
ThanksTrial and error solved the problem.
When there is an error XML the dataset for the dynamic select
field is based on, then the whole region in to which the dataset
was linked will not be shown.
The 'error' in my case, it appears, were non-US keyboard
characters (from a german keyboard). The underlying database mysql
is set to UTF8-unicode, and the xml-export function has
$xmlExportObj->setDBEncoding("UTF-8");
$xmlExportObj->setXMLEncoding("UTF-8");
in its code.
Once those characters were removed, it all worked fine.
To make things even more confusing was the fact that the page
worked fine in Firefox when the detailed region just would not show
in IE7 due to the special characters.
A bug or a compatibality issue for the Adobe crew to check
out ?
Comments welcome... -
Report Control and Multiple Datasets/Result Sets
I have four results sets, Plan, Forecast, Actual and SPLY per eight different product lines. I want to add conditional formatting of background color if actual is above or below Plan and/or Forecast. The report needs to export properly to Excel.
Is there a way I can use one control rather than multiple text boxes to display the data, allow for conditional formatting and export to Excel.? Thanks!
Environment:
SSRS 2010
SQL Server 2012Hi blairv,
If I understand correctly, you have a dataset in the report which include four fields: Plan, Forecast, Actual and SPLY. Each filed contains eight values.
In SQL Server Reporting Services (SSRS), we can use table, matrix or list display report data in cells. The cells typically contain text data such as text, dates, and numbers but they can also contain gauges, charts, or report items such as images.
Reference: http://technet.microsoft.com/en-us/library/dd220592.aspx
In your case, we can use expression to configure these items background color. Please refer to the following steps:
Click a specific text box in the report. Click BackgroundColor prompt in the Properties dialog box.
Click Expression prompt. And fill with expression below:
=IIF(Fields! Actual.Value>Fields! Plan.Valeu Or Fields! Actual.Value>Fields! Forecast.Valeu,”Red”,”Blue”)
Reference: http://msdn.microsoft.com/en-us/library/ms157328.aspx
If there are any miunderstanding, please feel free to let me know.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support -
Hi,
I am working on a report what has 10 datasets derived from 10 different select statements.
Is it possilbe to save those 10 select statements as a macro / stored procedure and then use that macro to generate those dataset in the ssrs report builder ?
AshishSinghalHi AshishSinghal84,
According to your description, you want to write multiple select statements in a procedure, then use the procedure as dataset in the report, right?
According to my knowledge, when we write multiple select statements in a procedure, we have to create relationship between these select statements, otherwise it will only return the first one query's fields. If you are using SSRS 2008 R2, you can use Lookup
function to display these fields from different datasets on one data region control, but the prerequisite is that you must have one common field. For more information about lookup function, please see:
http://msdn.microsoft.com/en-us/library/ee210531.aspx
If all these solution you cannot achieve due to your special condition, the last workaround is to use subreport to display all the fields together.
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
Wendy Fu
TechNet Community Support -
Flarecreate for zfs root dataset and ignore multiple dataset
Hi All,
I want to write a script to create flar images on multiple servers. In non zfs filesystem I am using -X option to refer a file to exclude mounts on different servers.
but on ZFS -X option is not working. I want multiple mounts to be ignore on ZFS base system during flarecreate.
I can use -D option to ignore the datasets on the server but it is not serving my purpose as i am maintaining a common file to ignore the mounts on all different servers.
Please help me in thisRenaming the root pool is not recommended.
-
Need multiple datasets from ColdFusion
I want to get some non-related data from a few different
tables in a database all at creationComplete(). Is there a way to
pull multiple distinct queries in one function and assign them to
individual ArrayCollections?
AlNot sure is this is a CF question you have or an AS question.
They way I dod this kind of thing (and I don't use CF or any of the
regular classes in AS either) is on the server I'll construct an
xml document that essentially is a merge of each of the "datasets".
Then on the client and split the xml document into its
dataset parts and assign them to the relevant classes that are
interested in these datasets.
Very high level explanation, but I'm not sure what you're
using on the client side and what options you've already explored.
Shiv. -
Multiple dataset fields lookup
This is an example of using a Spry region to implement Zuggest like results.
http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html
However, I want the text can be searched into multiple fields in the dataset.
I simply tried adding a "category" to the array of fields to be searched
and hope the array should be passed as the fifth argument.
But It doesn't work~~
=====
Before
=====
<script language="JavaScript" type="text/javascript">
var ac2 = new Spry.Widget.SimpleAutoSuggest("productTF", "productMenu", function(acWidget, str) { MyQueryFunc(acWidget, str, document.getElementById("productCB").checked, dsProducts, "name"); });
</script>
====
After
====
<script language="JavaScript" type="text/javascript">
var ac2 = new Spry.Widget.SimpleAutoSuggest("productTF", "productMenu", function(acWidget, str) { MyQueryFunc(acWidget, str, document.getElementById("productCB").checked, dsProducts, {"name","category"}); });
</script>Try
// FilterData() and StartFilterTimer()
function MyQueryFunc() {
var tf = document.getElementById("productTF");
if (!tf.value)
// If the text field is empty, remove any filter
// that is set on the data set.
dsProducts.filter(null);
return;
// Set a filter on the data set that matches any row
// that begins with the string in the text field.
var regExpStr = tf.value;
if (!document.getElementById("productCB").checked)
regExpStr = "^" + regExpStr;
var regExp = new RegExp(regExpStr, "i");
var filterFunc = function(ds, row, rowNumber)
var str = row["name"];
if (str && str.search(regExp) != -1)
return row;
var str = row["category"];
if (str && str.search(regExp) != -1)
return row;
return null;
dsProducts.filter(filterFunc);
function StartFilterTimer() {
if (StartFilterTimer.timerID)
clearTimeout(StartFilterTimer.timerID);
StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; MyQueryFunc(); }, 100);
Gramps -
I have a SQL Server Reporting Services report that has a textbox within a Report with variations of the following expression
=Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0)
and
Iif(Fields!PointID.Value = 500, 1, 0)) / Sum(Iif(Fields!PointID.Value = 500, 1, 0))
I see the following error when I try to preview the report:
The Value expression for the text box ‘Textbox2’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.
What am I missing in this this expression to make it run incorrectlyCan you include dataset name in your sum functions? e.g. Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0)
and
Iif(Fields!PointID.Value = 500, 1, 0)) should include your dataset name as Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) and Iif(Fields!PointID.Value = 500, 1, 0),"datasetname")Like wise Sum(Iif(Fields!PointID.Value = 500, 1, 0)) should also have dataset name Sum(Iif(Fields!PointID.Value = 500, 1, 0),"datasetname")
Gaur -
How do I use multiple datasets?
Here is what I need to do. I need the user to choose a product via pop-up menu. When a product is chosen, data would load into another pop-up menu as to where (regions list - state/province) you can purchase the product. Once a location is chosen from that list this would then load data into a placeholder with a list of specific locations. Kind of similar to this http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html But how does this work? How does it call and load the other datasets? Thanks.
you can’t programmatically add messages/channels to an already existing task
So I can't create a task with more than one message, and I can't add a message to an existing task.
That sounds like I have to have a separate task for each message I want. That means separate READ operations at DAQ time. I hope the overhead doesn't cost too much (I'm doing a thousand other things at DAQ time).
I have an RT card in the system I'm designing. It's only using about 5% of the CPU time (PID controlling an engine). Will NI-CAN stuff work on the RT? How do I physically connect it? Is CAN just RS-232 at fast baud rates, or are there more electrical differences?
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks -
Want to use the same #TEMP table for multiple datasets in SSRS 2005
I am using Visual Studio 2005 to create SSRS 2005 reports. The report will consist of two different matrix from two different dataset that will gather data from the same data source. The first dataset is a procedure that inserts data from a query into
a #temp table and outputs it in the first matrix. I want the second dataset to be a different procedure that references the same #temp table. When the report is pulled then can the #temp table be dropped.Try in the Dataset properties. In the Query tab, under and to the right of "Data source:" click the box with the elipses (...). In the General tab, toward the bottom, there is a check box beside "Use single transaction".
Rakesh M J | MCTS,MCITP ( SQL SERVER 2008 )
Dont forget to mark it as Answered if found useful |
myspeakonbi -
Multiple dataset problems with ie
Hi You all;
I have been having an bug that accures only on IE. I have a two dataset that is tied to a region. One display values and one checks to see what to display.
here is a snippet:
<div spry:region="rsTop2merchants rsWatchMerchant pvMerchantitemsData" class="SpryHiddenRegion">
//if rsWatchMerchant::availability has a vlue show this
<div id="scroll" spry:if="'{rsWatchMerchant::availability}' > '0'">
<div class="loading_small" spry:state="loading">calculating...</div>
<div class="error" spry:state="error">Failed!</div>
<div id="supermarket">{merchant_name}</div>
<div id="price">{price}</div>
</div>
//if rsWatchMerchant::availability has no value show this
<div id="scroll" spry:if="'{rsWatchMerchant::availability}' == '-1'" style="margin-top: 5px;">
<div id="some_txt" >
No {pvMerchantitemsData::supercategory} merchant and or product added as yet!
</div>
</div>
</div>
All of this works fine including on IE except when rsTop2merchants dataset returns no value ie trips and give me Failed spry state. Every thing works fine on all the other browsers.
PROBLEM
When rsTop2merchants is called using rsTop2merchants.loaddate() it seems to update the region before rsWatchMerchant can do get values and do its evaluation
But rsTop2merchants need to be called first because it does the queries and make all the updates in the database which rsWatchMerchant then retrieves
POSSIBLE SOLUTION
Is there a way that i can call rsTop2merchants.loaddate() and have it not update the region until rsWatchMerchant has retrieve it values.
OR
Is there a way to have IE not trip when rsTop2merchants does not return a value(ie this problem only occures when rsTop2merchants does not return a value)Have you tried
spry:if="{rsWatchMerchant::availability}"
and
spry:if="!{rsWatchMerchant::availability}"
Gramps -
Using Multiple Datasets and Spry in DW CS3
Hi there, I am currently trying to get an XML file pushed
into a HTML page by using Spry in Dreamweaver CS3.
However it uses three datasets. The schema is like this:
funds-and-headings
----> properties+
------------> region
------------> reference
------------> known-as
------------> funds+
---------------------> type
---------------------> heads+
-----------------------------> description
(where there is a + this means a heading)
but I am struggling to pull in the data.
If I highlight 'properties' I can pull in the first 3 records
but funds gives an 'unspecified' error message.
I just want to know how I can then pull in the other fields
all into one line and return all the results from the XML.
Any hlep most welcome and sorry if I missed anything out that
would help.Thought I'd drop a url so that my issue is more clear. :)
This is in Alpha, but a url would be:
http://center4spine.com.s11267.gridserver.com/how_we_help/spinal_decompression/
. You'll see the categories on the left; clicking a title changes
the content on the right. The first category's content is displayed
initially. I need to be able to link directly to the FAQ. How do I
get that page to show up with the FAQ loading first via a
hyperlink? I hope that's more clear!
Maybe you are looking for
-
After 10.7.5 update my macbook freezes
Its been 3 days since I updaated my MacBook Pro and ever since the raibow wheel comes on and the whole thing freezes, i tryed the pram, load in safe and v mode, i do get an error at the page: smcreaddata8 failed . Could that be the problem? Before th
-
I sold my ipod (which has always been backed up to itunes/computer) and am waiting for a new Ipad. Do I have to manually download all my apps on the ipad, or will itunes allow me to sync my old ipod apps and music to the ipad?
-
How do I update my CS5 so that I can process my Fuji X-E1 raw files
How do I update my CS5 so that I can process my Fuji X-E1 raw files
-
i am unable to use GPS on my Nokia E65. can u please tell me how i can use GPS on my mobile fone. secondly tell me does it coast some thing
-
All, I have created a client proxy in CRM system and i have tested in from SE80 and everything works i retrieve data and works fine. But now i have created a test program where i use a client proxy and i send the request with the same parameters, but