How to pass parameter to RDLC report - rdlc

I am new to reports creation in ASP.net (Local Report). I have used rdlc file to create my report. Objective is, On clicking of the reservation button in a aspx page, the data has to be stored in db and page should open a popup window to show the report (saved details) to the user.
I have created a rdlc file and created/added a parameter too.
my Aspx page:
<rsweb:ReportViewer ID="ReportViewer" runat="server" Font-Names="Verdana" Font-Size="8pt"
ZoomMode="PageWidth" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" ProcessingMode="Local"
WaitMessageFont-Size="14pt" PageCountMode="Actual" Width="750px" Height="500px">
<LocalReport ReportPath="Reports.rdlc" EnableExternalImages="true"
EnableHyperlinks="true">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPaymentVoucherDetailsByWSId"
TypeName="Controllers.ReservatoionController">
</asp:ObjectDataSource>
Controller.cs
Created a public method that accepts the Primary key of the record and return the object to the report.
Query:
How do I pass the primary key from main page to Controller class to get the result?
how to set the primary key value dynamically to report?

Check Below Link It shows a demo for pass parameter value
www.youtube.com/watch?v=ko1Uejtdi1g

Related

How do i make and attache action to button

Hello I have created a button on my Odoo 10 form "SET geprint" now i want to attach an action to the button. If i press the button the value of the boolean geprint must change to 1. How can I make this possible?
If possible i would also like to create that button in the list view to update multiple records.
Thx for your help
I tried your code but i am getting the following error now
(name field to update is x_geprint)
button code :
You can do it via following methods.
Create object type of button in form view. you can give button type="object", after that when you click on button then system will call python method In which you can write your code.
ex:
<button name="validate" string="Validate" type="object" states="draft" class="oe_highlight"/>
#api.multi
def validate(self):
self.write({})
return True
For the list view you need to create new wizard, In which you can select number of records from list view and in list view Action select your wizard name item.
Ex:
from openerp import models, fields, api, _
class test(models.TransientModel):
_name = 'test.test'
<act_window name="Name String" res_model="wizard.model"
src_model="source.model" view_mode="form" view_type="form"
target="new" multi="False"
id="your_id"
view_id="view_id"
context="{}"/>
In source model Action menu you can select wizard link and In the wizard you will get active_ids in context.
active_ids means all list-view selected records, based on that you can do it any operations with selective records.
This may help you.
Make a server action (settings - > technical - > Server actions)
After that search for the action number in your link please see image (my number is 638)
Then go to the form where you want to add the button. In my example its stock.move
Go into edit formview and add the following code
<button name="638" string=" Set geprint" type="action" />

VB.net dynamic table ID

I'm dynamically populating a table via VB.NET using jQuery and ajax but I need the physical table ID to change to fire table specific events on the front end that will be recognized by jQuery.
I've googled and tried passing a variable without any any success. It is possible to load a table dynamically and change the displayed ID in vb.net?
<asp:Table ID="<%=dynamicTableID%>" runat="server"> </asp:Table>
any feed back ins appreciated.
Thanks,
You may want to use the data attributes for something like this. Instead of parsing out a dynamic id you can do something like
<asp:Table ID="<%=myId%>" runat="server" data-src="<%=someUniqureAttr%>"> </asp:Table>
You can access this field in jquery like this
$('table').data("src")
And use a selector like this
$('table[data-src="myUniqueAttr"]')

in struts where can we find the property_name of <bean:write name="name" property="property_name" />

I am new to struts and i am viewing an example of struts project and it has a table in which it has various number of data and to obtain that data from the data base it uses the code in the place of field to gain the data from database but i didn't see the name main_actvt_name which is the property anywhere.where can i find that in the action or in the form or in the jsp file.Guys help me out

SharePoint 2010: RemoveFieldRef and Inherits="TRUE"

I have created a custom content type that inherits from the OOTB SharePoint Picture content type. The only customisations I have made is to add a simple URL field, and remove two of the fields on the base type. See below:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Picture (0x010102) -->
<ContentType ID="0x0101020027f16ab27e6e45a6848c25c47aaa7053"
Name="Custom Picture"
Description=""
Group="Custom"
Inherits="TRUE"
Version="0">
<FieldRefs>
<RemoveFieldRef ID="{b66e9b50-a28e-469b-b1a0-af0e45486874}" Name="Keywords" />
<RemoveFieldRef ID="{a5d2f824-bc53-422e-87fd-765939d863a5}" Name="ImageCreateDate" />
<FieldRef ID="{c29e077d-f466-4d8e-8bbe-72b66c5f205c}" Name="URL" DisplayName="URL" Required="FALSE" />
</FieldRefs>
</ContentType>
</Elements>
If I create a picture library based on my custom content type, the "URL" field that I added appears in the new/edit forms, however the two fields that I have attempted to remove are also displayed, i.e. the RemoveFieldRef's are being ignored. If I look at the content type in "Site Settings -> Content Type Gallery", these two fields are still listed there.
Setting Inherits="FALSE" on my custom content type (see MSDN definition) successfully removes just these two fields from the "Site Settings -> Content Type Gallery" page, however then none of the base fields are displayed in the new/edit forms -- only my custom "URL" field.
What can I do to ensure that all the fields from the base "Picture" content type are displayed on the new/edit forms of my picture library except the two fields that I have specifically removed?
I believe the nature of this issue to be the understanding of how content type inheritance works.
From MSDN (http://msdn.microsoft.com/en-us/library/aa544268.aspx)
If Inherits is TRUE, the child content type inherits all fields that are in the parent, >including fields that users have added.
If Inherits is FALSE or absent and the parent content type is a built-in type, the child >content type inherits only the fields that were in the parent content type when >SharePoint Foundation was installed. The child content type does not have any fields that >users have added to the parent content type.
If Inherits is FALSE or absent and the parent content type was provisioned by a sandboxed >solution, the child does not inherit any fields from the parent.
I think the key phrase above is "If Inherits is TRUE, the child content type inherits ALL fields that are in the parent including fields that users have added."
This means that in order to accomplish what you set out to do you will have inherits set to false and you will have to include FieldRef elements for all fields you wish to use in your content type.
You make no reference / don't include code for how the content type was added to your list instance. Make sure this has been updated to support the removal or setting of inherits to false.
These sites support what is described here.
http://kvdlinden.blogspot.com/2011/06/issues-with-removefieldref-and.html
http://nelsonlamprecht.wordpress.com/2010/08/25/sharepoint-2010-removefieldref-and-inherits%E2%80%9Dtrue%E2%80%9D/

Getting the data out of the data Formview

I have an ASP pg with a formview list control on it that hooks up to a sql database customer table
I want to access the customer name outside the form.
How do I:
A) access the bound text box in the form view template? Something like Text1.text=formview1.customername.text (that doesn't work but that's the kinda thing)
B) access the database field in the table that the sqlsource connects to to feed the formview
Really appreciate the help. I bet it's easy to do but I'm just not getting there.
You are going to want to use the DataBinder Class. For example:
<asp:formview id="formViewContainer" ... other code>
..... formview code .....
<%# Eval("CustomerName") %>
..... more formview code .....
</asp:formview>
Then to access "CutomerName" outside of the formview use the DataBinder as follows:
<asp:textbox id="customerName" runt="server"
text='<%# DataBinder.GetPropertyValue(formViewContainer.DataItem, "CustomerName") %>' />