Minggu, 03 Januari 2016

Re: [MS_AccessPros] Display picture on report for specific Consignment

 

John,

Finally i  am able to see picture on my report, getting help from one article of microsoft in this regard from Google, I left all other details
and concentrated on the last paragraph as below:

Open Report in Design view and then add an image control to the report by using the Image tool in the toolbox.
You are prompted to select an image to insert. Select any image that is available on your computer. Name the control ImageFrame.
Set the Format Event of the "Details" section of the report to the following Event Procedure:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me![Imageframe].Picture = Me![Imagepath]
End Sub

(Note: I used the above in my ReportFooter as per my requirement)

Open the Report in Print Preview mode. Notice that the report displays the corresponding bitmap for each record.
Note: You may need to amend the file paths and image names to correspond with images stored on your system.

Thank you very much John for helping me.

Regards,
Khalid 


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

You need an Image control (the name doesn't matter), and set the Control Source of that control to Photo.  You can optionally display the contents of the Photo field (the path to the photo) in a Text Box control.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Jan 3, 2016, at 8:48 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,
Yes! The file does opens on double clicking in the folder.

Please let me re-confirm what are the controls on the report to display the report. Presently i have two controls to display the picture, apart from other controls.

1- ImageFrame
2- ImagePath , having record source "Photo|"

Is this OK, and there is no code to display the picture as you told me.

Please help in this matter as my boss needs it urgently.

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

That seems to imply that it can't find the file.  Can you navigate to that folder in Windows Explorer?  Can you see the file?  What happens if you double-click on the file?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Jan 2, 2016, at 8:41 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,
Yesterday i tried to reply you from my cell but it failed. What i remembered the error was Run-time error '490' and i was unable to see something on my browser.

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

And can you access that path on the computer you're running the app?  What happens if you go to the Immediate Window and type:

Application.FollowHyperlink "D:\PCTL\BarCode\2015-B-08.Jpg"

.. and press Enter?  That should open the file - perhaps in your browser.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 31, 2015, at 8:03 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,
Yes  it contain:

D:\PCTL\BarCode\2015-B-08.Jpg 
On the report i can see it in this format without quotes and also if run query there also it is in this format.

Photo is Text field YES.

What else to check so that i could see picture on the report?

Please help.

Regards,
Khalid
 


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

Just because you have GROUP BY in the queries used in your FROM clause does not mean you have to use it in a query that joins two GROUP BY queries.

If the Photo field contains a valid path to a picture, then using it as the Control Source of an Image control should display the contents of the file.  Does Photo contain:

"D:\PCTL\BarCode\2015-B-08.Jpg"

.. or does it contain:

D:\PCTL\BarCode\2015-B-08.Jpg

I assume Photo is a Text field.  The contents should not include the quotes.  And drive D must be accessible from where the app is running.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 30, 2015, at 7:24 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,
The GROUP BY clause in my SQL is because it came from two queries as below:
~~~~~~~~~~~~~~
Query: "SaleInvoiceSelectedConsignClients"
SELECT SaleInvoiceSelectedConsignClients.ConsignmentNo, SaleInvoiceSelectedConsignClients.ClientCIN, SaleInvoiceSelectedConsignClients.ProductNameEnglish, SaleInvoiceSelectedConsignClients.ProductNameRussian, Count(SaleInvoiceSelectedConsignClients.CartonNo) AS CountOfCartonNo, Sum(SaleInvoiceSelectedConsignClients.ProductQty) AS SumOfProductQty
FROM SaleInvoiceSelectedConsignClients
GROUP BY SaleInvoiceSelectedConsignClients.ConsignmentNo, SaleInvoiceSelectedConsignClients.ClientCIN, SaleInvoiceSelectedConsignClients.ProductNameEnglish, SaleInvoiceSelectedConsignClients.ProductNameRussian;
~~~~~~~~~~~~~~
Query: "SaleInvoiceSelectedConsignClients1"
SELECT SaleInvoiceSelectedConsignClients.ConsignmentNo, SaleInvoiceSelectedConsignClients.ClientCIN, SaleInvoiceSelectedConsignClients.ProductNameEnglish, SaleInvoiceSelectedConsignClients.ProductNameRussian, Count(SaleInvoiceSelectedConsignClients.CartonNo) AS CountOfCartonNo, Sum(SaleInvoiceSelectedConsignClients.ProductQty) AS SumOfProductQty
FROM SaleInvoiceSelectedConsignClients
GROUP BY SaleInvoiceSelectedConsignClients.ConsignmentNo, SaleInvoiceSelectedConsignClients.ClientCIN, SaleInvoiceSelectedConsignClients.ProductNameEnglish, SaleInvoiceSelectedConsignClients.ProductNameRussian;
~~~~~~~~~~~~~~
Reports Record Source is query "SaleInvoiceSelectedConsignClients2" having sql:

SELECT SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [RateOfLocalCurrency]*[InvoiceRate]/135 AS PriceOfProduct, [SumOfProductQty]*[PriceOfProduct] AS SaleValue, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate
FROM Importer INNER JOIN ((((SaleInvoiceSelectedConsignClients1 INNER JOIN [Invoice Values PakCaspian Ammended] ON (SaleInvoiceSelectedConsignClients1.ProductNameEnglish = [Invoice Values PakCaspian Ammended].ProductNameEnglish) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo)) INNER JOIN SaleInvoice ON (SaleInvoiceSelectedConsignClients1.ClientCIN = SaleInvoice.ClientCIN) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = SaleInvoice.ConsignmentNo)) INNER JOIN BuyerInvoiceCountry ON SaleInvoice.CountryOfBuyerInvoiceEng = BuyerInvoiceCountry.CountryOfBuyerInvoiceEng) INNER JOIN [Consignment Number] ON ([Consignment Number].ConsignmentNo = SaleInvoice.ConsignmentNo) AND ([Consignment Number].ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Consignment Number].ConsignmentNo)) ON Importer.ImporterID = [Invoice Values PakCaspian Ammended].ImporterID
GROUP BY SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate;
~~~~~~~~~~~~~
I am still unable to see picture on my report. To open the report the Dialog Form has two controls "ConsignmentNo" and "ClientCIN"

Please tell me more why the picture is not showing on the report.

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

You don't need any code at all.  Put the name of your field containing the path - Photo - in the Control Source of your Image control.

I see no reason why you have a GROUP BY clause in your SQL.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 29, 2015, at 9:06 AM, Khalid Tanweer khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi John,
As you have been always helping & guiding me for my questions and problems and providing the best
solutions. Sometime before you helped me how to view an image on a form by clicking a command button.

Now it is a new situation. I need to display an image/picture on a report. What I've tried and struggled
up to now is that only I can get is that on the Text Box: ImagePath having Control Source: Photo
I get correct data, for example to open the report through Dialog Form "Dialog Sale Invoice" and selecting
a "ConsignmentNo" say 2015-B-08 on the reports control "ImagePath" i get "D:\PCTL\BarCode\2015-B-08.Jpg",
but unable to view the picture anywhere, i have also put an Unbouond Image: ImageFrame on the report.

I put some code seeking help from Access Help and i am not sure wether they are correct i paste them below:

Private Sub Report_Current()
'On Error Resume Next
    Me![ImageFrame].Picture = Me![ImagePath]
End Sub
~~~~~~~~~~~~~
Private Sub ImagePath_AfterUpdate()
 'On Error Resume Next
    Me![ImageFrame].Picture = Me![ImagePath]
 End Sub
~~~~~~~~~~~~~~
Reports Record Source is query "SaleInvoiceSelectedConsignClients2" having sql:

SELECT SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [RateOfLocalCurrency]*[InvoiceRate]/135 AS PriceOfProduct, [SumOfProductQty]*[PriceOfProduct] AS SaleValue, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate
FROM Importer INNER JOIN ((((SaleInvoiceSelectedConsignClients1 INNER JOIN [Invoice Values PakCaspian Ammended] ON (SaleInvoiceSelectedConsignClients1.ProductNameEnglish = [Invoice Values PakCaspian Ammended].ProductNameEnglish) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo)) INNER JOIN SaleInvoice ON (SaleInvoiceSelectedConsignClients1.ClientCIN = SaleInvoice.ClientCIN) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = SaleInvoice.ConsignmentNo)) INNER JOIN BuyerInvoiceCountry ON SaleInvoice.CountryOfBuyerInvoiceEng = BuyerInvoiceCountry.CountryOfBuyerInvoiceEng) INNER JOIN [Consignment Number] ON ([Consignment Number].ConsignmentNo = SaleInvoice.ConsignmentNo) AND ([Consignment Number].ConsignmentNo = [Invoice Values PakCaspian Ammended].ConsignmentNo) AND (SaleInvoiceSelectedConsignClients1.ConsignmentNo = [Consignment Number].ConsignmentNo)) ON Importer.ImporterID = [Invoice Values PakCaspian Ammended].ImporterID
GROUP BY SaleInvoiceSelectedConsignClients1.ConsignmentNo, SaleInvoiceSelectedConsignClients1.ClientCIN, SaleInvoiceSelectedConsignClients1.ProductNameEnglish, SaleInvoiceSelectedConsignClients1.ProductNameRussian, SaleInvoiceSelectedConsignClients1.CountOfCartonNo, SaleInvoiceSelectedConsignClients1.SumOfProductQty, [Invoice Values PakCaspian Ammended].InvoiceRate, [Invoice Values PakCaspian Ammended].ImporterID, Importer.ImporterNameEnglish, SaleInvoice.BuyerCompanyName, SaleInvoice.Buyer, BuyerInvoiceCountry.CountryOfBuyerInvoiceRus, SaleInvoice.BuyerINN, Importer.ImporterCountryRussian, SaleInvoice.Seller, Importer.SellerINN, SaleInvoice.DateOfSale, SaleInvoice.RateOfLocalCurrency, [Consignment Number].Photo, [Consignment Number].CustomDeclarationNo, [Consignment Number].CustomDeclarationDate;
~~~~~~~~~~~~~
The picture which is required on the report would be a scanned image of Bar Code from a document for each "ConsignmentNo"
there will be a unique Bar Code image.

Please help in this matter.
Regards,
Khalid





__._,_.___

Posted by: khalidtanweerburrah@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (12)

.

__,_._,___

Tidak ada komentar:

Poskan Komentar