how can i make a report in Cognos 10 using render variable so that i can achive results on same page. Report should have a dropdown choice for user to view output in LIST or CROSTAB.
There are a few ways i'll show one that you are already very close to getting.
Create a Variable named something like "vReportFormat" that say does a case on the parameter that determins the format
Example
Variable Name: vReportFormat
Case
When ?Param? = 'List'
Then 'List'
Else 'Crosstab'
End
In the Render Variable Property of the List select your newly created variable "vReportFormat" and then select only the output value "List" that you created when you made the variable. By selecting only List when the report runs it will evaulate the variable first and then the list will only render if the output value is 'List' - Repeat this variable assignment for the crosstab but of course pick 'Crosstab' as the output value.
There are other variations like creating two report pages and using the render variable on the Page object itself - works the same exact way.
Hope this helps.
Related
I am using PowerApps Canvas for the first time. I have created two screens. One has a gallery connected to an excel sheet. It displays the table contents from the excel file. And the second screen has some input text fields. I want to enter values in these fields and click on submit, so that when I go to the other screen I can see this new record in the gallery. I want to use the collect function for the submit button but it is showing problem with using Record1 (name of the global variable in which I am storing the excel table). It says the specified data source cannot be used.
Collect(Record1,
{
AgentName:TextInput1.Text,
ID:TextInput4.Text,
Shift:TextInput2.Text,
Weekoff:TextInput3.Text
}
)
I am setting Record1 as a global variable in the onStart property.
Set(Record1,Table1);
Edit: I ran onStart and the error is not there but new record isn't being displayed on the gallery. There is an error with setting the global variable Unexpected Characters. The formula contains 'Ident' where 'Data' is expected.
Making a global variable wasn't required. I just used the excel table directly in the other screen and the collect function works now.
You want to store your input into your excel right? You need patch instead of collect. Collect is for local storage, patch creates an item in the datasource.
I have a custom page type for Staff and there's a field called Function. I have a WHERE condition in a repeater like this: Function LIKE '%insurance%' and got an error Incorrect syntax near the keyword 'Function'
From the error I guess Function is a reserved keyword, so I changed the field name to BusinessFunction. However right after changing the field name, I noticed all the values for that field become blank. If I changed it back, the values are back to normal. The question: is there a way to change the field name while keeping the values that are already there -- without access to the backend database?
Wrap the word Function in brackets like so should resolve the problem: [Function]
When you say the values of the field are blank do you mean on the display side in the repeater? Have you changed the transformation to use the new field name? Have you updated the Columns property of the repeater to use the new field name vs. the old one? It will not lose all the data, you just need to ensure all the values of the property/field name are updated everywhere including any custom code you might be using for this page type.
I have a report that I developed that utilizes render variables as described here - http://www.ibm.com/developerworks/data/library/cognos/reporting/dynamic_report_design/page570.html
The report for some reason still renders the column header without the data below when its exported to Excel. If I view in HTML, it renders appropriately but the HTML includes every single column header.
What am i doing wrong?
Check "Making the Query Items Dynamic" #4 from that document. Looks like you miss it
When you are applying the Render Variable, make sure you are selecting the 'List Column' not the 'List Column Body'. Look into the attached screenshot to see how to select the complete List Column when applying the Render Variable.
I'm not sure why this technique wouldn't work when exported but as a workaround, you could try applying the render variable independently to the column and its header.
I recently got tasked with customizing a report in an access database, I havent touched access in years so its a little rusty for me. I have successfully added the Fields to the table, added them to the form and added them to the report. If i run the report they query correctly. But all the other fields on the report are setup with an expression such as:
=IIF([Mold Temp High]=0,"----",[Mold Temp High])
Now the expression makes 100% to me but when it auto populates the field, such as Mold Temp High, for all the previous fields i can see they show up as Record Source Column fields, but for any new field i have added shows up as a Text Box.
If i create an expression with the new fields i get a Circular Reference and it shows #type on the report instead of the value.
Just curious to why the new fields show up as TextBoxs and not Record Sources.
I'm guessing that you are dragging the new fields from the field list. When you do this, it creates the text box with the exact same name as the data field. So when you use this name in an expression, it thinks you are referencing the text box object. To prevent this problem, make sure that every time you create a new textbox (or any control) from a data field that you name it something different by setting the Name property of the text box. Generally I just add "txt" to the front of the field name. This will ensure that you are always explicitly referring to either the textbox name or the data field name.
What if you change your logic around a bit..
We remember, IIF is constructed as:
=IIF((Some_Table_Field or value),True-condition,False-condtion)
You maybe looking at:
=IIF([Mold Temp High]=NULL,"----",[Mold Temp High])
Or, maybe (use ISNULL or ISBLANK it has been a while for Access with me as well):
=IIF(isnull([Mold Temp High]),"----",[Mold Temp High])
Or, rather:
=IIF([Mold Temp High]<1,"----",[Mold Temp High])
Hope this makes sense.
I need to create a repeat using two fields on the same form. In other words, the repeat has to appear at the bottom of the form like we used to do with embedded views. On this repeat I have two columns. They both have the same number of entries and they need to line up. The fields are OriginalFileName and NewFileName.
On first column (OriginalFileName), each row has to become a link and the second column is just the list from the second field (NewFileName). The URL can be either the attachment as it exists on the document itself or if it has been detached, it has to become the path to where it is stored on the network. The path is also stored as a variable on the document so once it is detached, it is filled in.
First, is it possible to create a repeat using values from the document that contains the repeat?
Second, how do I write the HTML that I need to add to make the URL in either case. The path for the detached file will always be the same for all rows in the repeat, it is just the file name that changes.
If you know how many entries there are in the multivalue item then you can set the repeat's data source to be based on javascript and just return the number of times you want to repeat. If you don't know the number of items in the multivalue field then you can set the repeat's data source to be the document and field. In both cases you'll need to set the max repeat value to higher if you suspect that you'll have more then 30 entries so all can be displayed at the same time or you can add a pager pointing to the repeat component.
Accessing the data of the two fields is fairly easy, a multivalue field is just an array and you can pick out a single item of the array using a document.getItemValue("fieldName")[arrayIndex]. To know what array index your on in the repeat there is a configuration field for 'Repeat Index' where you can type in a variable name, just use that variable name for arrayIndex.
Now it is just a case of building your table or list in the repeat and adding in link and computed text controls that use the arrayIndex to get their values.