How do I remove a value from the prompt list in cognos report studio - cognos-10

I created a value prompt in cognos report studio just as the one below.
[Class Code] in (?p_Class_Code?)
when I run the report, of course I get the prompt
Class Code
Provide a Value:
A123
B456
C789
D101
E123
What if I want to remove C789 from the list of the value prompt? It is a NULL Class Code that's why I want to remove it so that users won't encounter it and use it among the Class Codes.
How should I do that?

I know this is four months old and I'm guessing you've found a solution. If not, you need to:
Create a query containing the column you want to filter on that excludes the value you don't want your user to see and select. This is done via a filter such as [Class Code] <> 'C789'
Add your own value prompt, most likely on a prompt page, and specify the query you created in step 1 as the source.

Related

Crystal Report same parameter in different commands

I have to use same parameter(paramCompanyId) in both the commands.
I will be setting the parameter value on code.
crystalReportDocument.SetParameterValue("paramCompanyId",LoggedInMembersCompanyID);
Note:
command:crmleadsbycustomer => retrieves report data
command:crmopportunity => dynamic filter dropdown data
Issues:
If I use the same parameter it keeps on prompting without executing
the report.
I don’t want user to enter parameter on prompt so I am setting up in
code.
I don’t want to use separate parameters for each command (this way
works fine)
Edit parameter and change the list of values to "Dynamic" and under "Value", choose the companyID column from command "crmopportunity".
Create a new formula: {?paramCompanyId}=companyID column from command "crmleadsbycustomer".
In the Record Select Expert, use this formula to filter the records.

Powerapps - get stuck with UpdateContext

I am trying to build a PowerApp to log setup times of our machines by our fitters.
This is what my app looks like:
There are buttons named "Uhrzeit". Pressing these will write the current date and time into the Date/Time fields. I am using the following code:
UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})
The Date/Time field is named Total8.
The code is working well but after saving the form and opening a new record the old data is still available in the fields. By clicking on the button "Zeiten zurücksetzen" I can "delete" the old data.
UpdateContext({Total8:""})
Problem: When I open one of the older records the old data is not available in the form. There is only the value of the last record. In the Common Data Service where my records are saved the values are correct.
As an example, I am saving this record:
When I open a new record, the values of the record 1 are still available. This should not be the case if my app worked properly.
For your Information:
If I enter the date/time without tapping the button, saving the record and opening a new record I don't have the problem. I think the "UpdateContext" code is not the code I should use here.
Can anyone help me solve the problem?
I don't think there's a problem with using the contexts in this way -- but remember that a context is just a variable. It isn't automatically linked to a datasource in any special way - so if you set it equal to Now(), it's going to keep that value until you do something different.
When you view an old record, you need to get the data from CDS and update your contexts to match the CDS data. Does this make sense?
Yeah thats my problem.
I want the variable to be linked to a datasource. Or is it possible to write the date/time into the fields without using a context variable?

How to get all rows from Page list and convert them to CSV utilizing pxConvertResultsToCSV

I have a Repeat grid layout, as a source is Report definition. The grid displays twenty row per page. So, if there are thirty-three rows, there are four pages.
I have got a task to export all grid's data to CSV. I have found out the pxConvertResultsToCSV activity. It requires to pass PageList with the properties to convert. I use pgRepPgSubSectionMySectionListB.pxResults to do this. But I have realized, that the property pxResults contains only first twenty elements of pgRepPgSubSectionMySectionListB. But I must export to CSV all the rows. How can I reach this? Thank you.
First run your report by calling pxRetrieveReportData activity of class Rule-Obj-Report-Definition in you acticity
Syntex:- call Rule-Obj-Report-Definition.pxRetrieveReportData
It will ask for parameters:-
pyReportName :- your report definition name
pyReportClass:- class of the report definition
pyPageName :- any page name for example ReportListExport. This page must be defined in Pages & Classes of class Code-Pega-List
After successful execution of this step, you will get ReportListExport.pxResults in Clipboard.
Now use this pxResults for export.
There is one more activity to export your Report in excel.
Call pzViewExportToExcel activity after running your report. And keep ReportListExport.pyReportDefinition as step page of this step.
This is preferred one.
This question is a bit old now so I'm sure the OP has probably solved the problem and moved on at this point. But for future viewers there is an easier way to solve this.
Pega includes a gadget called the "Record Editor" which can be used to display a report definition as an editable data table. It shows the provided report definition in a simple table as normal but users can also edit the rows, delete the rows and add new ones. It also includes import and export actions at the top so users can drop the entire resultset being shown in the table to CSV and then re-import changes back in after editing. You can find more information on this gadget and how to use it in this community article
If you simply want to provide an option at the top of a table sourced from a report definition that allows users to export the results as CSV without using the record editor gadget there is an API for that as well. The activity "pxDownloadDataRecordsAsCSV" in class "PegaAccel-Task-DataTableEditor" does this. It accepts the class and name of a report definition as parameters, runs that report and serves up the contents as a CSV file.
The second part here isn't too different from AJ's solution it's just an already existing parameterized activity you can use instead of writing one yourself.

How to create prompt page driven variable view in Cognos 8.2

I am using Cognos 8.2 to create a report with a prompt page. I am trying to create a prompt page that allows the user to choose what type of item they want to see, and then the workers assigned.
Example: Show me the workers working on projects of type 'A' and that would trigger a list of workers to be displayed who are currently working on projects of type 'A' and then the user could choose a worker/workers from the list to be displayed in the report.
I am trying to use javascript in the html item, but I have never worked with javascript before, and I am having little luck. I dont know if it is even possible or not to pass a variable to another item on the prompt page. Any ideas or examples would be appreciated.
Bring your worker names into a data item (eg [People]) - then, create another data item with a case statement:
CASE
WHEN ([People] in ('John','Jessica','Jane','Jeff'))
THEN ('Group J')
WHEN ([People] in ('Adam', 'Alex', 'Anne'))
THEN ('Group A')
ELSE 'No Group'
END
Name this data item "Group"
Then create a filter on the query: [Group] = ?Group Prompt?
Then you should be able to input 'Group A' and get only those from Group A.

Passing Parameters to Sub Reports in RDLC Under VS 2010

Currently I'm working on a reporting website in VS 2010 using ASP.Net 4.0 and the 2010 RDLC designer. The report I'm building is similar to a Master-detail report, but I'm trying to do it with nested tables.
My issue is that I'm trying to pass a field value from my main report to a sub report. The table setup looks something like this:
2 Tables
First Table: [RecordID, Name, Date,]
Second Table: [RecordID, Description, DueDate]
What I want to do is a table like this:
-------------------
| Name | Date |
------------------------------------
| Description1 | DueDate |
------------------------------------
| Description2 | DueDate |
------------------------------------
| Name2 | Date2 |
-----------------
With the entries for Description and DueDate bieng part of the sub report.
When I try to pass the RecordID in to the subreport as a parameter, which I have to manually define in the XML of the subreport because I can't find anywhere in the designer UI that will allow me to add report parameters to RDLC files, I get an error from the main report that says:
An error occurred during local report processing.
Value cannot be null. Parameter name: value
So it appears to be erroring out before it ever reaches the point where it does the subreport loading.
I am getting data sent to the main report just fine, and if I remove the parameter from the subreport the data comes through. But if I add the parameter the report throws the error.
Does anyone have any ideas on what might be causing this?
I actually ended up figuring this out.
If you're using Visual Studio 2010 you need to go into the report definition file and make sure the Report Data window is open.
If you can't find it go to View and click on Report Data.
Once you have the window open right click on the Parameters folder and add the parameter there.
In the parameter declaration box make sure you select Allow Null Value and Allow Blank Value if it's a Text type. This should stop that error from happening.
For some reason, even though I always had a value, with local reporting it initializes the report parameter with null causing it to throw that error if you do not allow nulls/blanks.
Nobody seems to understand that the sub-report data needs to be shown /filtered based on the main report column values. Sorry for complaining but after spending quite a time, I figured this out.
We need to define report parameters as mentioned above in the subreport, we need to pass the parameter values to the datasource used by sub-report to display the subreport data. Given below is the snippet.. I have used ObjectDataSource to populate the subreport.
Public Sub SubreportProcessingEventHandler(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
'e.Parameters.Item(0) is the report parameter defined in Sub-report
ObjectDataSource2.SelectParameters("Param1") = New Parameter("Param1", DbType.Int32, e.Parameters.Item(0).Values(0))
ObjectDataSource2.SelectParameters("Param2") = New Parameter("Param2", DbType.String, e.Parameters.Item(1).Values(0))
e.DataSources.Add(New ReportDataSource("SubReportDataSourceName", ObjectDataSource2))
End Sub
I just ran into same thing converting a report from VS2005. Anyhow, another thing I found was that the parameter had to be set in TWO places...
First, in the sub-report version, you have to declare the parameter(s) you are EXPECTING to receive coming in and its respective type.
In addition, from the MAIN report, if you right-click to the sub report, properties, there is a section for the "Parameters" that you want to pass TO the sub report. This would be from whatever record basis in the master report that will drive the sub report.
Just wanted to pass this on as clarification to others who may encounter or just be learning about handling sub reports in VS2010.

Resources