Effects of granular structure on the d.c transport in underdoped superconductors