2014-04-22 6 views
1

내가 자원이 object reference not set to instance of object설정 하위 보고서 텍스트 객체는

어떻게 나는 여기

ReportDocument rDocument = (ReportDocument)Session["ReportSource"]; 

((TextObject)rDocument.Subreports["HolidaySubReport"].ReportDefinition. 
ReportObjects["HolidaySchedule"]).Text=Resources.Resources.HolidaySchedule; 

하지만 난이 오류가 발생하고 아래 시도 코드를 file.This를 통해 하위 보고서 헤더 텍스트를 설정하고 싶었 보고서 나는이 문제를 해결한다. 아무 도움도 인정 될 것이다.

+0

어디에서이 오류가 발생합니까? –

+0

'TextObject'로 변환 할 때 두 번째 줄 – SparAby

+1

rDocument.Subreports에 HolidaySubReport가 있는지 확인 했습니까? –

답변

0
TextObject txtpentotal = (TextObject)objRpt.Subreports["Subreport.rpt"].ReportDefinition.Sections["Section4"].ReportObjects["txttotal"]; 
txtpentotal.Text = pen.Text; 
+1

수정 사항을 설명하는 텍스트와 문제 해결 방법을 입력하십시오. 스택 오버플로시 코드 전용 답변이 싫증납니다. – clearlight