mibuso.com

Microsoft Business Solutions online community
It is currently Wed Jun 19, 2013 11:12 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: how to show picture from database in RTC
PostPosted: Tue Apr 05, 2011 11:28 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
hi all
i'm using NAV 2009 R2
i want to show company logo,which is uploaded through company information
how to show it in RTC reports at the header?
thanks


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Tue Apr 05, 2011 11:37 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4254
Location: New Delhi
Country: India (in)
Just follow this link :thumbsup:

http://blogs.msdn.com/b/nav-reporting/archive/2009/02/05/how-to-add-a-company-picture-to-a-report.aspx

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Tue Apr 05, 2011 11:59 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
mohana_cse06 wrote:

thanks a lot ! \:D/


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 5:06 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
mohana_cse06 wrote:

i already use all the steps
but why still not working :(


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 5:13 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
i try to change this code become visible
Code: Select all
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)


but the result is #Error


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 10:15 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
julkifli33 wrote:
i try to change this code become visible
Code: Select all
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)


but the result is #Error


if it shows "#Error", it means that there's something wrong.
1. Are you sure you've passed the right value to the function Convet.ToBase64String?
2. Did you call CalcFields for Picture field?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 10:38 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
Troubles In Paradise wrote:
julkifli33 wrote:
i try to change this code become visible
Code: Select all
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)


but the result is #Error


if it shows "#Error", it means that there's something wrong.
1. Are you sure you've passed the right value to the function Convet.ToBase64String?
2. Did you call CalcFields for Picture field?


1. in body... i add textbox. and then the expression i add
Code: Select all
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)


2. yes... i add in onPreReport
Code: Select all
CompanyInfo.Calcfields(Picture);


for your information Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
--> the bold one in expression is still red underlined


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 10:45 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
julkifli33 wrote:
[for your information Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
--> the bold one in expression is still red underlined


This is "normal", also if it will show the picture it will remain red underlined.
Did you try to rewrite code in the textbox that containts convertion? if haven't done yet, try using the assist edit...

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 11:15 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
Troubles In Paradise wrote:
julkifli33 wrote:
[for your information Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
--> the bold one in expression is still red underlined


This is "normal", also if it will show the picture it will remain red underlined.
Did you try to rewrite code in the textbox that containts convertion? if haven't done yet, try using the assist edit...

yes i did it several times

i attach my steps and result
please take a look
what did i miss?


Attachments:
File comment: Code added in report properties
Code.jpg
Code.jpg [ 64.35 KiB | Viewed 1184 times ]
File comment: design Layout
LayOut.jpg
LayOut.jpg [ 94.85 KiB | Viewed 1184 times ]
File comment: result
Result.jpg
Result.jpg [ 56.41 KiB | Viewed 1184 times ]
Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 11:24 am 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
All seems correct.
Could you attach a screenshot of the "About this Report" please?
The idea I have is that DataSet hasn't the value of the Picture field in the moment you do the convertion.

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 11:48 am 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
Troubles In Paradise wrote:
All seems correct.
Could you attach a screenshot of the "About this Report" please?
The idea I have is that DataSet hasn't the value of the Picture field in the moment you do the convertion.


what do you mean "About This Report" ?
in classic mode it showed the picture
but i added calcfields in section


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 12:01 pm 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
After have launched the report press CTRL+ALT+F1.
Or use the question mark:
Attachment:
about.png

after this the system will ask you to redo it and then you will see the DataSet.

Quote:
but i added calcfields in section


You said before that you placed calcfields in section... hope not in a section trigger...

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 12:08 pm 
Offline

Joined: Wed Sep 29, 2010 3:18 am
Posts: 764
Country: Australia (au)
Troubles In Paradise wrote:
After have launched the report press CTRL+ALT+F1.
Or use the question mark:
Attachment:
The attachment about.png is no longer available

after this the system will ask you to redo it and then you will see the DataSet.

Quote:
but i added calcfields in section


You said before that you placed calcfields in section... hope not in a section trigger...

yes i know... in section trigger it doesn't affect the RTC
i add calcfields twice
1 in section... (just for testing classic), and another one is in onPreReport

here the attachment for About This Report


Attachments:
About.jpg
About.jpg [ 42.98 KiB | Viewed 1163 times ]
Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 12:17 pm 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
This is the problem... As you can see from your screenshot the Companyinfo_Picture hasn't value (otherwise you would see '*' in its column, since it's a BLOB), so when you pass it to convertion function it has nothing to convert.

In which section you placed the Image in classic report?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: how to show picture from database in RTC
PostPosted: Wed Jun 15, 2011 1:32 pm 
Offline

Joined: Thu Jan 29, 2009 5:06 pm
Posts: 359
Location: Sofia
Country: Bulgaria (bg)
and don't forget to call CompanyInfo.GET somewhere before the CALCFIELDS :wink:

_________________
-Mihail- [MCTS]


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: