Helllo, How to add image from Path In RDLC report?? Where in database only image name is saved.
And Reporting Code Like that
{
EmployeeDataSetTableAdapters.tblAdditionalInfoTableAdapter adpPic = new EmployeeDataSetTableAdapters.tblAdditionalInfoTableAdapter();
EmployeeDataSet.tblAdditionalInfoDataTable tblPic = new EmployeeDataSet.tblAdditionalInfoDataTable();
adpPic.Fill(tblPic);
ReportDataSource mds2 = new ReportDataSource("Pics", (DataTable)tblPic);
this.ReportViewer1.LocalReport.DataSources.Clear();
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("PrintID.rdlc");
this.ReportViewer1.LocalReport.DataSources.Add(mds2);
this.ReportViewer1.LocalReport.Refresh();
}
Check below links. It will explain how images add in RDLC Report.
The video contain a demo of works
https://www.youtube.com/watch?v=RxS323bLdFs
http://easyprogrammingtechniques.blogspot.in/2014/02/how-to-add-image-in-rdlc-report.html
Related
I have some spreadsheets in MS excell. Trying to convert them to PDF by using PHPOffice and mPDF class. I have a problem to create and display footers on every created PDF page
This is working code for creating a PDF from spreadsheet.
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf($pe);
Is there any solution or method i can call after this to generate footers before use save() method?
Thanks in advance
You can use the footer methods e.g. generate a footer with linenumbers
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx");
$spreadsheet = $reader->load('<path>'); //Path of reader sheet
$sheet = $spreadsheet->getActiveSheet();
$sheet->getHeaderFooter()->setFirstFooter('&C&"-,Bold"Page &P from &N'); //generate Fristfooter
There are more header/footer possibility look documentation or class documentation
if anybody konws this,please help me.how to give name to pdf.
i generated pdf using mpdf codeigniter. on click of a button the pdf wil be viewed. but how can give name for that pdf? it shows 1 on the top of the pdf.how can i give name to that pdf?
My controller
public function viewpdf($key,$option) {
if($option=='1')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata1($key);
}
if($option=='2')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata2($key);
}
if($option=='3')
{
$searchdata['fetchproduct']=$this->b2bproduct_model->fetch_productdata3($key);
}
$html=$this->load->view('moderator/pdf_data', $searchdata,true);
//this the the PDF filename that user will get to download
$pdfFilePath = "shany.pdf";
//load mPDF library
$this->load->library('m_pdf');
//generate the PDF from the given html
$this->m_pdf->pdf->WriteHTML($html);
//download it.
$this->m_pdf->pdf->Output($pdfFilePath, "I");
}
Use this code.
$mpdf=new mPDF();
$mpdf->SetTitle('My Title');
$mpdf->WriteHTML('<p>Hallo World</p>');
$mpdf->Output('filename.pdf');
Set the title for the document. The title is displayed at the top of the Adobe Reader screen when viewing the PDF file
Use code as bellow
public function mypdf() {
$this->load->library('pdf');
$pdf = $this->pdf->load();
$html=$this->load->view('welcome_message',null,true);
$pdf->WriteHTML($html);
// write the HTML into the PDF
$output = 'your_given_name.pdf'; //You can give a name of your generated pdf file or you can create it auto on timestamp by using $output = time().'.pdf'.
$pdf->Output("$output", 'I');
}
If you send data to view page then replace the variable with null in line 4.
For more details please see the tutorial from here.
If you are interested on DOMPDF please see from here.
I created an image directory in my projects in the UI folder to place my images.
So the full path is currently Resources/UI/Images.
When i create an image view it wont display the images.
I tried different options, even a web image but nothing works?
var self = Ti.UI.createView({
backgroundColor:'white'
});
var imgv = Titanium.UI.createImageView({url:"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Volkswagen_Logo.png/600px-Volkswagen_Logo.png"});
self.add(imgv);
var imgv = Titanium.UI.createImageView({url:"../images/sb02.jpg"});
self.add(imgv);
var imgv = Titanium.UI.createImageView({url:"Resources/ui/images/sb03.jpg"});
self.add(imgv);
There is an error in your code. There is no url property for ImageView control. You should use image property. Try the following code
var imgv = Titanium.UI.createImageView({
image:"../images/sb02.jpg"
});
self.add(imgv);
To answer my question thanks to Anand for the tips:
Images should be placed in the Resources dir
Afterwards reference them just by /folder/image.jpg in my case /images/sb1.jpg
I am working with RDLC Report in 2010
I want to bind image from external source
ReportParameter rpara = new ReportParameter("rpt1", "D:\\Projects\\Image\\logo.jpg");
ReportViewer1.LocalReport.EnableExternalImages = true;
ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rpara });
I also set all the property of rdlc design like
add parameter rpt1 in report data window
add new image in body part then set image property to external and select report parameter
everything okay but still I am not able to get image on my report viewer
Try to use this way
string imagepath = "File:///" + "C:\\image.jpg";
this.reportViewer1.LocalReport.EnableExternalImages = true;
ReportParameter[] param = new ReportParameter[1];
param[0] = new ReportParameter("Path", imagepath);
this.reportViewer1.LocalReport.SetParameters(param);
this.reportViewer1.RefreshReport();
I am using RadMosaicTile in my windows store application. I want to bind images with it.
I tried this
RadMosaicHubTile tile = new RadMosaicHubTile();
tile.ImageSources.Add("Image1.jpg");
tile.ImageSources.Add("Image2.jpg");
but it is not working. images are not binded.
Can anyone help me?
Thanks.
The have this code sample on the telerik forum - does this work for you?
Collection<object> imageSources = new Collection<object>();
ImageSource image = GetImageFromWeb();
imageSources.Add(image);
RadMosaicHubTile hubTile = new RadMosaicHubTile();
hubTile.CreateImageSource = (source) =>
{
return (ImageSource)source;
};
hubTile.ImageSources = imageSources;