Click here to Skip to main content
14,454,912 members
Rate this:
Please Sign up or sign in to vote.
See more:
im creating barcode with the help of a fount style .its working fine on offline and when i host it on server and also copy that fount on my directory its showing fine but when i download for print or generating into the Pdf file then bar code not working

What I have tried:

Private Sub SingleStudent()

       ReportViewer1.ProcessingMode = ProcessingMode.Local
       ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reporting/Report38.rdlc")
       Dim dsCustomers As Customers = GetData("SELECT dbo.MonthlyFeeGenrate.*, dbo.School_Info.* FROM dbo.MonthlyFeeGenrate CROSS JOIN dbo.School_Info where MonthlyFeeGenrate.registration_id = '" & getcurrentinfo.Text & "' AND MonthlyFeeGenrate.Fee_Month = '" & getmonth.Text & "'AND MonthlyFeeGenrate.Fee_Year = '" & getyear.Text & "' AND MonthlyFeeGenrate.School_id = '" & schoolID.Text & "'AND MonthlyFeeGenrate.Received_Fee = '0'")
       Dim datasource As New ReportDataSource("DataSet1", dsCustomers.Tables(0))
       ReportViewer1.LocalReport.DataSources.Clear()
       ReportViewer1.LocalReport.DataSources.Add(datasource)
   End Sub
Posted
Comments
Richard MacCutchan 10-Feb-20 3:52am
   
What does "not working" mean?
Richard Deeming 11-Feb-20 10:54am
   
GetData("SELECT dbo.MonthlyFeeGenrate.*, dbo.School_Info.* FROM dbo.MonthlyFeeGenrate CROSS JOIN dbo.School_Info where MonthlyFeeGenrate.registration_id = '" & getcurrentinfo.Text & "' AND MonthlyFeeGenrate.Fee_Month = '" & getmonth.Text & "'AND MonthlyFeeGenrate.Fee_Year = '" & getyear.Text & "' AND MonthlyFeeGenrate.School_id = '" & schoolID.Text & "'AND MonthlyFeeGenrate.Received_Fee = '0'")


Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.

Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]

You need to fix your GetData method so that you can pass the parameters correctly. You then need to review all of your code that calls the GetData method to make sure you're not concatenating parameter values into the query.

Edit: As multiple people have been telling you since June. 🤦‍♂️

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100