Display database image in RDLC report from a specific row in database - vb.net

working with VB.net and RDLC reports. At the top of the report, I would like to show the company logo stored in my database.
I create an image and assign the image field from the database to it and it displays the image (this works).
Problem is it is pulling out the FIRST image in the database.
What I would like to do is show the image related to the specific company name. Seems like RDLC doesnt allow this...
I am forced to pick: =First(Fields!CompanyLogo.Value, "MyCompanyInfo")
What I need is:
Fields!CompanyLogo.Value WHERE CompanyName is 'ABC'

Related

Displaying database records in a grid/ table using vb.net (2010)

I am using vb.net 2010 to code an app that displays data on a form from an access database in a table/grid as shown below. The display must be dynamic not static as in the form below.
Each database record in the form has the attributes Name e.g "Room1", cost, description, and an OLE Object representing the image. The form above is not connected to any database it just displays static images and text.
I need help on how I can retrieve data from the database and display it as shown above not in a datagridview. Thank you.

How to program crystal report to lookup a record in a table

i Have a Table with Fields
Material Number
Order Code
Supplier Code
Description
I have a crystal reports rpt file that i manually enter all the information to generate labels.
I am trying to program this using the built in formula editor, so when i enter the Material Number (which is a unique code) it will automatically display other 3 relevant fields.
I have tried few formulas in the formula editor without any luck.
can anyone help?
relliK
UPDATE
#Siva - I have added the table for clarification
i simply want a lable printed with only one user input being the Material Number, and then the code/fomula in crystal reports to fetch the other data based on the Materila number and produce the label.
thank you for you interest in this issue.
UPDATE
#Siva - I have added a sample label, i would only want to enter 20506871 as Material and the other data fields to be pulled from excel
not sure if i can use parameter fields and/or i would like some help on programming the parameter fields

Substitute one table for another at runtime

I have 9 tables with state information in them. They all have the same field names. I have a Crystal Report that is based on one of them. I want the user to be able to select a state and change the Crystal Report to use that table instead of the one it was based on.I mean when user select text in combo box and then click on "OK" then report show (using only one rpt for all the tables of same fields).
How do I do that in VB.Net?
Could you base the Report on a Stored Procedure and pass in a parameter so the Stored Procedure knows which table you want the data from?
I remember trying to get a Crystal Report (v2005) to switch database source from the one it was designed against and that wasn't easy - every table had the connection details in it if I recall correctly! (maybe changing tables is easier though)
It's not easier but if the tables have the same structure you should be able to do it. But you should create a new Document for it and call SetDataSource for your new table. After this you can set the document as ReportSource to your viewer.

Images in Crystal Reports

I am working on Windows Forms Projects.
I am creating a report for customers.
The report data is pulled from a "CustomerDetails" table.
A field in the table is called "CustPhotoName", this holds a string which relates to an image file.
I Currently have a report set up which runs for a single customer by passing in a customer ID. Then using the passed in ID to populate a Dataset with an ImageRow and then a sub report with the image from the dataset.
I am wanting to set up this report where I can pass in an array of customer IDs and produce the reports (1 page per customer with image (if CustPhotoName has value))
Please can someone let me know how is the best way to do this for the multiple customers.
Add a CustomerID parameter to the report. Type Number. Set it to allow multiple values. In the report's record-selection formula, add the following:
AND {table.customer_id} IN {?CustomerID}
You probably want to group the report by {CustomerID} as well. In the group's footer, select Section Expert and check New Page After. This way each customer will start on a new page.

Displaying Image from SQL Server in Crystal Reports

I have a couple of images in my SQL Server 2008 table of which the datatype is image.
In my VS.net 2008 project I have a crystal report which is displaying all the fields from that table, but the image is showing as a blank image.
Any thoughts, How I can make it work?
You have to convert the image before you can show it.
In crystal reports, you can click on the image control and set the value property of the control to the following (replace ImageFieldName with your field name)
System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value), 105))
If using the image location data in Table, I use this solution.
Add/Insert Picture box to your Designer, right click on the picture box - Format Object, On the Tab Picture there is Graphic Location option below, use formula and add your image location Field from your database table.
If blank make sure you put the Picture box in the right section (header or detail section)